-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Button has to be tapped twice on iOS (svelte5) #13339
Comments
This isn't a Svelte 5 bug. This is a well known iOS bug that has been around for ages (it also affects Svelte 4, but it subtly different ways due to how Svelte 4 appends elements to the document). The issue is because of iOS's buggy support for |
Thx a lot for the hint. |
I translated the sample to pure-html and for some reason here the error occurs independant of the number of the surrounding elements:
<button
onclick="window.alert('TEST')"
onmouseenter="show()"
>
Button 1
</button>
<div id="insert"></div>
<script>
function show() {
document.getElementById("insert").innerHTML = "\t\t\t\t\t<button onclick='() => {}'>Button 2</button>\n"
}
</script> STRANGE... |
Yeah |
Describe the bug
This is a very strange bug. The script below does not fire
on:click
when tapping "Button 1" on Safari on iOS. Only when tapping a second time the assigned alert message pops up.The Problem does NOT occur if ANY of the following conditions is met:
div
s which are enclosing "Button 2" is removedon:click
of Button 2 is removedReproduction
unfortunately the problem is not reproducable on svelte-5-preview.vercel.app.
But the Problem can be easily reproduced by starting a svelte 5 project and add the following
+page.svelte
:Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: