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 <xhmikosr@gmail.com>
This commit is contained in:
parent
2630b05eb3
commit
0839cbf04d
2 changed files with 31 additions and 32 deletions
|
|
@ -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
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue