Search
Other Modals questions
Forum

J4 Modals Beta - Opening Modal disables listeners

John Bongiovanni's Avatar John Bongiovanni
I have a modal with a button whose class sets up an onclick listener.
Before the modal is open, I see that the listener is enabled (via the Chrome inspector).
When I open the modal, the button does not work, and I see that the listener is gone from it.

It's a simple modal opened by a button.
John Bongiovanni's Avatar John Bongiovanni
Another example of the problem is if the modal has a Joomla calendar field. The Calendar icon does nothing.
Peter van Westen's Avatar Peter van Westen ADMIN
Do you have this online so I can take a look?

PS: If you open a URL in a modal, it will be opened in an iframe.
Please post a rating at the Joomla! Extensions Directory
John Bongiovanni's Avatar John Bongiovanni
Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
The way you have structured the page, is that you have the exact same form on the page multiple times.
And these forms have the same id.
This will cause errors.

Try disabling the Modals system plugin and reload that page.
Then you can see those duplicate forms in the page more clearly.
Please post a rating at the Joomla! Extensions Directory
John Bongiovanni's Avatar John Bongiovanni
I fixed the duplicate IDs (reusing the same Joomla form definition incorrectly), and I still have the problem.

I have distilled this down to a very simple case. Use the link below (on the same site), and you will see two buttons. One has a listener and displays an alert when clicked, and the other opens a modal. The modal has a button with a listener to display an alert when clicked.

As before, clicking the button in the modal does nothing. What I see in the Inspector is that the attached listener for the button disappears when the modal is opened.

There is a template problem generating duplicate IDs for login forms, but I'm guessing that has no impact here.

Confidential information:
(hidden)
John Bongiovanni's Avatar John Bongiovanni
Also, I installed the Dec 31 update.
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
John Bongiovanni's Avatar John Bongiovanni
Works great, thanks.
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription