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

Use jQuery.preventDefault instead of jQuery.stopImmediatePropagation. #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lseelenbinder
Copy link

I ran across a bug with using the library on an iPad. With stopImmediatePropagation, even if an alert is canceled, the action is still completed. Using preventDefault corrects the problem.

All tests pass.

@neerajsingh0101
Copy link

@lukeseelenbinder actually we need both stopImmediatePropagation and preventDefault.

preventDefault will let the event propagate.

Test case is missing it but a good test case for this scenario will check for both cases: clicking the link does not take user away. and clicking the link does not propagate.

@lseelenbinder
Copy link
Author

Should I make those changes (use both methods), produce a test case, and resubmit the pull request?

@neerajsingh0101
Copy link

@lukeseelenbinder yes.

@JangoSteve
Copy link
Member

@lukeseelenbinder no need to resubmit a pull request. If you make the changes and add a test case, you can force push to your branch and it will update this pull request.

@lseelenbinder
Copy link
Author

I can't seem to pin down where (and I'm still figuring out how) I should write the tests. It seems that .stopEverything() is not getting called at all for a['data-confirm'] elements.

@JangoSteve
Copy link
Member

.stopEverything() gets called for a['data-confirm'] elements on line 302.

The test should go in the test/data-confirm.js file.

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.

3 participants