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

Array access not supported in the use or transition directives #11467

Open
fcrozatier opened this issue May 4, 2024 · 0 comments · May be fixed by #11470
Open

Array access not supported in the use or transition directives #11467

fcrozatier opened this issue May 4, 2024 · 0 comments · May be fixed by #11470

Comments

@fcrozatier
Copy link
Contributor

fcrozatier commented May 4, 2024

Describe the bug

This syntax

{#each assembly.speakers as speaker, i}
	<button use:assembly.speakers[i].action>speaker {i}</button>
{/each}

gets compiled down to

$.action(button, ($$node) => assembly["speakers[i]"].action($$node));

so the array access doesn't work.

But all the other variations do work so it's a bit confusing / seems like a bug.

Same thing for transitions

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE5WS3W6DMAyFX8XLJg2kQu9bQNsz7LLpRUrdNRokKDarKsS7TwFCW3XazwWI-Dg-n206cdAVklhtOmFUjWIlXptGLASfG3-gT6wYxUKQbV3pIxmVTjdcSCNZ1411DN1B7bGHg7M1yOnKkp0ypFlbI8XaJ_unrBQRvDWoPtBBN4RZlT4LcohiyIsQlVxaQ7bCtLLvkRRHLUU8Sr0048fFA3LwEIPRJI9er0RY76ozhLo0mhPk8ESsGKPNNl5PnsO7dKgYA6THyosbKAaaRYOn0E8UhwqS-agpDVZp09Ixmk5xSHHIrTOh1KWzmX9wUoF_tArtRCNyUNMb5kHMlpdFmewhSWBvkcwzw8m6D5AmSQppukdU5XF2mZFBUSBbgB6wsl3LbA20hKu7_I3eptMetfleviyrCOPrdJ8tx7KeZelZ-sDrMelfhN3LNLPwQ_2AeXPh5j_6Bf5-FnPbf-9wmP20lv_3ee0-SVfDD5G_00CSFGIharvXB417sWLXYr_tvwCr6_BOHQQAAA==

Logs

No response

System Info

preview

Severity

annoyance

@fcrozatier fcrozatier changed the title Array access not supported for the use directive Array access not supported in the use directive May 4, 2024
@fcrozatier fcrozatier changed the title Array access not supported in the use directive Array access not supported in the use or transition directive May 4, 2024
@fcrozatier fcrozatier changed the title Array access not supported in the use or transition directive Array access not supported in the use or transition directives May 4, 2024
@paoloricciuti paoloricciuti linked a pull request May 4, 2024 that will close this issue
5 tasks
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.

1 participant