diff options
| author | Roni Diwan <[email protected]> | 2023-02-11 10:35:10 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-11 09:35:10 +0100 |
| commit | 7432ebc665042a7381a0682879996b049abb1ff6 (patch) | |
| tree | 723451838548b62182a73d7fae7de8457b0d6d11 /js/src | |
| parent | 9f5dca077751ff4abc2361d13766a4ed18ee04fc (diff) | |
| download | bootstrap-7432ebc665042a7381a0682879996b049abb1ff6.tar.xz bootstrap-7432ebc665042a7381a0682879996b049abb1ff6.zip | |
Unify `offcanvas` `keydown` event logic with `modal` (#38025)
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/modal.js | 1 | ||||
| -rw-r--r-- | js/src/offcanvas.js | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index 0a38586ce..a5adc8466 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -208,7 +208,6 @@ class Modal extends BaseComponent { } if (this._config.keyboard) { - event.preventDefault() this.hide() return } diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 54adf86cc..4d5975c0f 100644 --- a/js/src/offcanvas.js +++ b/js/src/offcanvas.js @@ -198,12 +198,12 @@ class Offcanvas extends BaseComponent { return } - if (!this._config.keyboard) { - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED) + if (this._config.keyboard) { + this.hide() return } - this.hide() + EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED) }) } |
