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
Bug in modal.js: defaultPrevented called on jQuery.Event instead of isDefaultPrevented() #31615
Comments
As a hacky workaround, I now do |
@Johann-S can you have a quick look please? Also please add the v4/v5 labels if this applies to both versions. |
it's just in v4 here, in v5 we use |
@joakimriedel can you please make a new PR against the v4-dev branch along with a test? |
Thanks for the bug report and the PR. #31696 was merged. |
Tried to prevent the
hidePrevented.bs.modal
event usinge.preventDefault()
, but it won't work since the code checks fordefaultPrevented
instead ofisDefaultPrevented()
.The bug on this line: https://github.com/twbs/bootstrap/blob/v4.5.2/js/src/modal.js#L237
All the other events are properly using
isDefaultPrevented()
see for example this line: https://github.com/twbs/bootstrap/blob/v4.5.2/js/src/modal.js#L117Here's a simple fix: https://github.com/twbs/bootstrap/compare/v4.5.2...joakimriedel:joakimriedel/defaultPrevented?expand=1
Patch for 4.5.2 ?
The text was updated successfully, but these errors were encountered: