I have this bug with 7.x-1.x, but it exists in 8.x-1.x and 8.x-2.x. I think it is customary to first fix the bug in the most recent branch.
modal.js contains the following code:
$(document).bind('keydown', modalEventEscapeCloseHandler);
...
function close() {
...
$('body').unbind('keypress', modalEventEscapeCloseHandler);
The bug here is that the event is bound to document.keydown, but unbound from body.keypress. This will leave the event handler after the modal is closed and create multiple event handlers when multiple modals are opened during a pageview.
The bug was introduced together with the feature in commit 0ec61b4f340981bb365b975661c99993676e9add and changed in commit 93cd187ccee28ade17da308d4012c28e724fc535.
I'll attach a patch shortly.
| Comment | File | Size | Author |
|---|
Comments
Comment #1
Jorrit commentedThe patch.
Comment #3
Jorrit commentedComment #6
Jorrit commentedComment #8
Jorrit commentedIt seems the branches 8.x-1.x and 8.x-2.x are not testable right now. The patch applies to all branches, so no backporting is needed.
Comment #9
Jorrit commentedComment #10
chris matthews commentedThe 4 year old patch to modal.js does not apply to the latest ctools 7.x-1.x-dev and if still applicable needs to be re-rolled.
Comment #12
joelpittetThere is no javascript files in the 8.x branch but thanks I've committed this to the 7.x branch.
Comment #13
joelpittet