You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Couldn't stop click event of a disabled button from bubbling #681
button0 is plain HTML/JS, no click handler triggered after click
button1 is a lit-element, handler triggered after click, seems click event is bubbling.
button2 is a lit-element, i called e.stopPropagation in the inner handler, still cannot stop it from bubbling.
Activity
Westbrook commentedon May 23, 2019
@mgenware in the case of
my-button-v2.tsyou are getting very close to what will be needed here, however to stop propagation to listeners on the same element you need to usestopImmediatePropagation()a la https://stackblitz.com/edit/hy4yqu-d6jkx9?file=my-button-v2.tsHere's the MDN docs on that API https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation
Good luck!
mgenware commentedon May 24, 2019
Wow it works! thanks @Westbrook
kevinpschaaf commentedon May 24, 2019
Sounds like there's not a LitElement bug here. Closing; please re-open if there is anything outstanding.