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

Issue with reactive attributes and slot attribute order #5626

Closed
ganigeorgiev opened this issue Oct 31, 2020 · 2 comments · Fixed by #4556
Closed

Issue with reactive attributes and slot attribute order #5626

ganigeorgiev opened this issue Oct 31, 2020 · 2 comments · Fixed by #4556

Comments

@ganigeorgiev
Copy link

ganigeorgiev commented Oct 31, 2020

Describe the bug
It seems that changes to reactive attributes are not reflected if the slot="..." attribute is defined at the end (or after the reactive attributes) of a named slot element. Example:

<button slot="footer" disabled={disabled}>Working</button>	
<button disabled={disabled} slot="footer">Not working</button>

EDIT
The above actually will work, but if both buttons have the slot attribute at the end, the disabled state is no longer reactive. So definitely there seems to be some issue with the order of occurrence of the slot attribute.

Logs
Nothing is logged. It just silently ignore the new state.

To Reproduce
Check the following repl - https://svelte.dev/repl/c90a72f4f9b14fde8775e81a22f44527?version=3.29.4

Expected behavior
I expect the order of the slot attribute to not have effect on the other reactive attributes.

Information about your Svelte project:

  • Svelte 3.29.4 (Rollup)
  • Chrome 86.0.4240.75
  • Fedora 32

Severity
I don't consider the issue severe, but it is annoying.

@kevmodrome
Copy link
Contributor

You have a typo in your REPL: <button dibled={disabled} slot="footer">Button2-Slot (not working)</button>, change it and both buttons will work the same.

@ganigeorgiev
Copy link
Author

ganigeorgiev commented Oct 31, 2020

@kevmodrome @Conduitry Actually, no. I've updated the description of the bug. The typo was one thing but it seems that if both buttons have the slot attribute at the end (or only one of the button is left) it doesn't work any more. See the updated repl - https://svelte.dev/repl/c90a72f4f9b14fde8775e81a22f44527?version=3.29.4

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

Successfully merging a pull request may close this issue.

3 participants