mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-08 06:36:33 +02:00
Selector Engine: fix multiple IDs (#39201)
* fix: regression of #38989 * Add unit test in selector-engine.spec.js --------- Co-authored-by: Julien Déramond <juderamond@gmail.com> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -991,6 +991,35 @@ describe('Modal', () => {
|
||||
trigger.click()
|
||||
})
|
||||
})
|
||||
|
||||
it('should open modal, having special characters in its id', () => {
|
||||
return new Promise(resolve => {
|
||||
fixtureEl.innerHTML = [
|
||||
'<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#j_id22:exampleModal">',
|
||||
' Launch demo modal',
|
||||
'</button>',
|
||||
'<div class="modal fade" id="j_id22:exampleModal" aria-labelledby="exampleModalLabel" aria-hidden="true">',
|
||||
' <div class="modal-dialog">',
|
||||
' <div class="modal-content">',
|
||||
' <div class="modal-body">',
|
||||
' <p>modal body</p>',
|
||||
' </div>',
|
||||
' </div>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
].join('')
|
||||
|
||||
const modalEl = fixtureEl.querySelector('.modal')
|
||||
const trigger = fixtureEl.querySelector('[data-bs-toggle="modal"]')
|
||||
|
||||
modalEl.addEventListener('shown.bs.modal', () => {
|
||||
resolve()
|
||||
})
|
||||
|
||||
trigger.click()
|
||||
})
|
||||
})
|
||||
|
||||
it('should not prevent default when a click occurred on data-bs-dismiss="modal" where tagName is DIFFERENT than <a> or <area>', () => {
|
||||
return new Promise(resolve => {
|
||||
fixtureEl.innerHTML = [
|
||||
|
Reference in New Issue
Block a user