mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
Close modal with keyboard=true & backdrop=static (#29986)
* Close modal with keyboard=true & backdrop=static
This commit is contained in:
committed by
XhmikosR
parent
4e1fb4fe1a
commit
954a0b1e6a
+5
-2
@@ -306,9 +306,12 @@ class Modal {
|
||||
}
|
||||
|
||||
_setEscapeEvent() {
|
||||
if (this._isShown && this._config.keyboard) {
|
||||
if (this._isShown) {
|
||||
EventHandler.on(this._element, Event.KEYDOWN_DISMISS, event => {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault()
|
||||
this.hide()
|
||||
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
|
||||
this._triggerBackdropTransition()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user