[Bug] LinkTo won't transition if a parent element stopPropagation
See original GitHub issue🐞 Describe the Bug
When a <LinkTo>
is inserted inside an element that stopPropagation
of click
’s, it won’t transition but rather fallback on a default <a>
behavior.
🔬 Minimal Reproduction
- Put a
<LinkTo>
inside an element thatstopPropagation
onclick
.
https://ember-twiddle.com/bac43dc0c91d12e7a9afb1d4adfcaabd
😕 Actual Behavior
- No transition
- Default
<a>
behavior
🤔 Expected Behavior
- An Ember transition to the
route
.
🌍 Environment
- Ember: 3.26.1
- Node.js/npm: 12.19.0 / 6.14.8
- OS: MacOS 10.15.5
- Browser: Chrome 90.0.4430.212
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
ui-sref on a parent element breaks all ui-srefs on children #2962
stopPropagation () when it handles the click event. So the transition to B gets superseded by a transition to A when the parent...
Read more >How to stop propagating event from parent div to child div
Anyways I will suggest Yuriy's answer. I just want you to know that you should put event.stopPropagation() in childrens(if you don't want event ......
Read more >How to correctly use preventDefault(), stopPropagation(), or ...
stopPropagation () Prevents the event from bubbling up the DOM, but does not stop the browsers default behaviour. For an in-depth explanation of...
Read more >stopPropagation() Event Method - W3Schools
The stopPropagation() method prevents propagation of the same event from being called. Propagation means bubbling up to parent elements or capturing down to ......
Read more >The Dangers of Stopping Event Propagation - CSS-Tricks
This bug happens because the Bootstrap code responsible for closing the dropdown menu is listening for click events on the document. But since ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That fix was released in 3.27.5
@lele-melis @kpfefferle Good find, thanks for reporting and sorry it wasn’t caught sooner (the assertions do run in tests, as well as inside the test suite in apps). I proposed a fix in #19597, but I am not sure if this is actually the same issue @jbescoyez reported as this parent-child relationship is the other way around here.