question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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 that stopPropagation on click.

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:open
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
chancancodecommented, Jun 10, 2021

That fix was released in 3.27.5

2reactions
chancancodecommented, Jun 10, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found