diff options
author | XhmikosR <xhmikosr@gmail.com> | 2021-10-09 21:49:49 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2022-01-29 14:25:30 +0300 |
commit | 0c3dfe104b520d6ce466f265bf60c6d74785972e (patch) | |
tree | 278d1f279237b31fdc373aa93fb539a923e00506 /js/src/util/focustrap.js | |
parent | 2964c12bb91b3a252aecbe1bc4041020e4efd622 (diff) |
Remove a few unneeded variables
Diffstat (limited to 'js/src/util/focustrap.js')
-rw-r--r-- | js/src/util/focustrap.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/js/src/util/focustrap.js b/js/src/util/focustrap.js index 46727ecf8a..88fd16b104 100644 --- a/js/src/util/focustrap.js +++ b/js/src/util/focustrap.js @@ -60,14 +60,12 @@ class FocusTrap extends Config { // Public activate() { - const { trapElement, autofocus } = this._config - if (this._isActive) { return } - if (autofocus) { - trapElement.focus() + if (this._config.autofocus) { + this._config.trapElement.focus() } EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop @@ -88,10 +86,9 @@ class FocusTrap extends Config { // Private _handleFocusin(event) { - const { target } = event const { trapElement } = this._config - if (target === document || target === trapElement || trapElement.contains(target)) { + if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { return } |