2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

Remove a few unneeded variables

This commit is contained in:
XhmikosR
2021-10-09 21:49:49 +03:00
parent 2964c12bb9
commit 0c3dfe104b
3 changed files with 12 additions and 19 deletions
+3 -6
View File
@@ -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
}