Skip to content
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

Event bubbling doesn't appear to be working as described: event bubbles up then circles back around to the child element #2019

Open
mapsedge opened this issue May 17, 2024 · 1 comment
Labels
bug Things that aren't working right in the library.

Comments

@mapsedge
Copy link

Describe the bug

Working with sl-menu and sl-menu[slot="submenu"], the sl-select event happens once on the child, once on the parent, then once again on the child. This makes event.target, event.currentTarget, and event.eventPhase useless for determining what was clicked on to prevent multiple event firings.

Demo

Go here: https://codepen.io/William-Morris/pen/oNRjaMW?editors=0010
Open the Developer Tools Console.
Select "Find", then any submenu item.
Check the console. The event bubbles like it's supposed to, but the fires again on the child element.

Browser / OS

  • OS: Kubuntu 24.04
  • Browser: Chromium 124, Firefox 125
@mapsedge mapsedge added the bug Things that aren't working right in the library. label May 17, 2024
@claviska
Copy link
Member

I would consider this a bug, as <sl-menu> should only emit one sl-select when an item is selected.

Any thoughts on this, @KonnorRogers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants