diff options
| author | Rohit Sharma <[email protected]> | 2020-11-20 19:06:24 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-20 15:36:24 +0200 |
| commit | 0839cbf04dd9b94dc2f9806751660d921beb72e9 (patch) | |
| tree | fc715f4af1107593013ae64808994a66a698ef56 /js/tests | |
| parent | 2630b05eb34c669d1771200b572efb09eb16c9f5 (diff) | |
| download | bootstrap-0839cbf04dd9b94dc2f9806751660d921beb72e9.tar.xz bootstrap-0839cbf04dd9b94dc2f9806751660d921beb72e9.zip | |
Don't hide modal when keyboard is set to false in modal's configuration (#32179)
* Don't hide modal when config.keyboard is false
* Update unit test
- Modal should not be closed when pressing esc key if keyboard = false
and backdrop is 'static'
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/modal.spec.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js index b9640097a..2a7319417 100644 --- a/js/tests/unit/modal.spec.js +++ b/js/tests/unit/modal.spec.js @@ -595,12 +595,11 @@ describe('Modal', () => { modal.show() }) - it('should not close modal when escape key is pressed with keyboard = false and backdrop = static', done => { - fixtureEl.innerHTML = '<div class="modal" data-bs-backdrop="static" data-bs-keyboard="false"><div class="modal-dialog"></div>' + it('should not close modal when escape key is pressed with keyboard = false', done => { + fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>' const modalEl = fixtureEl.querySelector('.modal') const modal = new Modal(modalEl, { - backdrop: 'static', keyboard: false }) |
