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

Only preventDefault on click on [data-toggle="modal"] when the element is a link #10834

Merged
merged 1 commit into from Dec 27, 2013
Merged

Only preventDefault on click on [data-toggle="modal"] when the element is a link #10834

merged 1 commit into from Dec 27, 2013

Conversation

Prinzhorn
Copy link

In it's current state Bootstrap always prevents the default action for a click event on [data-toggle="modal"] elements (see https://github.com/twbs/bootstrap/blob/master/js/modal.js#L233). Instead this should only happen when the element is a link.

Why? I'm opening a modal when the user chooses a particular radio button. But with the current Bootstrap version the radio button won't get selected, but the modal opens. I think the only reason why preventDefault is needed is to prevent the hash from appearing in the URL (and thus the browser from jumping to the top or said hash).

…t is a link

In it's current state Bootstrap always prevents the default action for a click
event on `[data-toggle="modal"]` elements
(see https://github.com/twbs/bootstrap/blob/master/js/modal.js#L233).
Instead this should only happen when the element is a link.
fat added a commit that referenced this pull request Dec 27, 2013
Only preventDefault on click on [data-toggle="modal"] when the element is a link
@fat fat merged commit bea46fc into twbs:master Dec 27, 2013
@fat
Copy link
Member

fat commented Dec 27, 2013

makes sense to me, thanks

@mdo mdo mentioned this pull request Dec 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants