-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Rerender blocks onclick trigger #15334
Comments
Mmm this might be browser related...on my phone it triggers everytime |
I don't think it triggers if you press the square or the circle? When pressing the white area in the button it works as it should, as it says in the description. |
Ugh, I should not read issues on the phone while also doing other stuff lol. But I think I might now where to look for this...will see if I can later or tomorrow |
I think it is just how the web works: |
Mmm i think @7nik is right: see this codepen https://codepen.io/paoloricciuti/pen/ogNbGbd?editors=1111 I'm gonna close this but feel free to open back again if you think this is wrong |
Describe the bug
I have a button with both onclick and onmousedown. Inside it renders an svg that has an if statement which renders either a circle or a rect.
In the repl, if you check the console, you can se the onclick event only fires every other time. Though if you either remove the if statement or the onmousedown event the onclick fires as it should.
Patrick from the Svelte discord wrote:
Edit: If you add
pointer-events: none
to the elements inside the svg everything works as expected.Reproduction
https://svelte.dev/playground/e80c01add66845a1a6f022d12dcd6bda?version=5.20.2
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: