-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Dropdown data-toggle="dropdown" element click events not bubble #30267
Comments
Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via CodePen/JS Bin or Stackblitz and report back with your link, Bootstrap version, and specific browser and OS details. This is an automated reply |
Here is demo code. codepen |
I wonder if this issue is present on v5 too? |
PRs welcome for both branches as usual, just make sure we have tests that catch the issue. |
Didn't look into the code, but buttons which are added can trigger form submits and |
was the |
|
Any news on this fix? |
Any chance the above PRs will get accepted? thanks |
Removing event.stopPropagation() looks fine to me. Tested with raw change like this and toggle button not work correctly anymore.
|
_addEventListeners function has two functions to prevent default link actions.
event.preventDefault()
event.stopPropagation()
If link element is not used for toggle, disabling events are not nesessary at all?
Reason is i need attach events to all toggle elements to get click events wanted from toggle elements.
Better way is to attach single event listener to parent and use event.target, this is not working now.
Is it possible to add check if toggle element is link, then add those events something like:
if(this._element.nodeName == 'a'){ event.preventDefault(); event.stopPropagation(); }
or using data attribute to disable/enable bubling.
The text was updated successfully, but these errors were encountered: