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

pointer-events: none; on icons within buttons? #626

Closed
trailsnail opened this issue Dec 19, 2021 · 2 comments
Closed

pointer-events: none; on icons within buttons? #626

trailsnail opened this issue Dec 19, 2021 · 2 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@trailsnail
Copy link
Contributor

Describe the bug

Hi,
(slotted) Icons within sl-button or sl-icon-button should not catch the click on the button itself.
It is a little bit confusing, if the cursor points on the icon while you try to click a submit button.

Demo: https://codepen.io/TrailSnail/pen/WNZOGwm

  1. Click the button within its default area: form will be submitted (see console)
  2. Click the button with cursor on the icon - nothing happens
Button Icon
grafik grafik

So the question: would it be correct, to add a pointer-events: none; to the icons by default?
At the moment we do theses workaround manually in our projects.
Greetings 😉

@trailsnail trailsnail added the bug Things that aren't working right in the library. label Dec 19, 2021
@trailsnail trailsnail changed the title pointer-events: none; on slotted icons within buttons? pointer-events: none; on icons within buttons? Dec 19, 2021
@claviska
Copy link
Member

That's probably the easiest workaround. Perhaps a better fix would be reworking the event listener so it accounts for the click event bubbling up from icons and anything else that might get slotted in.

Thanks for reporting this!

@claviska
Copy link
Member

This was fixed in dd65778.

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