Skip to content

Svelte 5: event handlers are case-sensitive #13245

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

Closed
kyoshino opened this issue Sep 15, 2024 · 3 comments
Closed

Svelte 5: event handlers are case-sensitive #13245

kyoshino opened this issue Sep 15, 2024 · 3 comments

Comments

@kyoshino
Copy link
Contributor

Describe the bug

In Svelte 5, event handlers like on:click are now onclick. However, onClick (capital C) doesn’t work even though it’s valid in HTML. I just realized it by accidentally writing onClick by myself.

Event handlers should be case-insensitive to avoid confusion.

Reproduction

REPL

Logs

No response

System Info

Svelte 5.0.0-next.246

Severity

annoyance

@brunnerh
Copy link
Member

@kyoshino
Copy link
Contributor Author

Closing this as unplanned is fine by me, but at least it should be documented.

@dummdidumm
Copy link
Member

Documented here https://github.com/sveltejs/svelte/blob/main/documentation/docs/02-template-syntax/02-basic-markup.md#events, which will appear on the final site soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants