- Issue created by @fraserthompson
The AJAX Dialog API conflicts with the regular Dialog API and causes it to behave differently when both are included on a page.
Create a node which contains a dialog which uses the Dialog API as documented here → :
<p>
<a id="test-dialog">open modal</a>
</p>
<div id="modal-content">
modal content
</div>
...and attach the JavaScript:
const dialogLink = document.getElementById('test-dialog');
dialogLink.addEventListener("click", (e) => {
const content = document.getElementById('modal-content');
Drupal.dialog(content).showModal();
});
...and attach the core/drupal.dialog library.
The button works as expected and can be opened and closed and opened again any number of times.
Now attach core/drupal.dialog.ajax as well. Now the button opens the first time, but won't open a second time after closing.
Either document that these libraries aren't meant to be used together, or (preferably) fix their behaviour so they do.
Active
10.1 ✨