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

Actions are not acceptable for <svelte:body /> #3163

Closed
PaulMaly opened this issue Jul 3, 2019 · 3 comments · Fixed by #6608
Closed

Actions are not acceptable for <svelte:body /> #3163

PaulMaly opened this issue Jul 3, 2019 · 3 comments · Fixed by #6608

Comments

@PaulMaly
Copy link
Contributor

PaulMaly commented Jul 3, 2019

Seems, we not able to assign actions to <svelte:body /> element: REPL

@btk5h
Copy link
Contributor

btk5h commented Jul 3, 2019

The docs are pretty clear that <svelte:body> is only for adding events to document.body.

What would putting an action on <svelte:body> even do (that isn't easily accomplished otherwise)?

@PaulMaly
Copy link
Contributor Author

PaulMaly commented Jul 3, 2019

@btk5h In Svelte 3 we don't have custom events anymore (events: {} sections in Svelte 2). So, actions are the only way to add a custom event, for example, a group of DOM events (eg. click/touch/etc) or some special stuff like use:enter={callback} which is triggering only on the enter key press.

I think, if <svelte:body> is for adding events, it should apply actions too.

@Conduitry
Copy link
Member

In 3.42.0, you can now use actions on <svelte:body>.

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

Successfully merging a pull request may close this issue.

4 participants