Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect return values of event handlers in jQuery.fn.onSafe #1670

Merged

Conversation

fredrikekelund
Copy link
Contributor

jQuery.fn.onSafe would previously not pass the return value of event handlers to jQuery. That meant that even if the event handler would return false, event.stopPropagation and event.preventDefault would not be called.

This came up as an issue for me after the recent merging of #1638, where I now had a set of .apos-buttons inside of an area, that was wrapped in an <a> element. Clicking the .apos-buttons would trigger a click on the link as well, and so the browser would navigate away from the page.

jQuery.fn.onSafe would previously not pass the return value of event
handlers to jQuery. That meant that even if the event handler would
"return false;", event.stopPropagation and event.preventDefault would
not be called.

This came up as an issue for me after the recent merging of apostrophecms#1638,
where I now had a set of .apos-buttons inside of an area, that was
wrapped in an <a> element. Clicking the .apos-buttons would trigger
a click on the link as well, and so the browser would navigate away
from the page.
@boutell boutell merged commit 9d38619 into apostrophecms:master Oct 16, 2018
@boutell
Copy link
Member

boutell commented Oct 16, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants