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

slot let:name value changes not propagating through inner slots #3472

Closed
WHenderson opened this issue Aug 29, 2019 · 5 comments
Closed

slot let:name value changes not propagating through inner slots #3472

WHenderson opened this issue Aug 29, 2019 · 5 comments
Labels

Comments

@WHenderson
Copy link

When using the slot:let directive to receive a value, changes to that value are not reactive inside nested slots.

e.g.
<Outer let:count={count}> <Inner> Inner Count = {count} </Inner> Outer Count = {count} </Outer>

When count changes, only the "Outer Count" text is updated.
https://svelte.dev/repl/63d04893dec14580a141d4d639021a21?version=3.9.1

I would expect that both "Outer Count" and "Inner Count" text would be updated.
May be related to #3364
I don't know the inner workings well enough yet to be sure.

Tested in

  • Chrome 76.0.3809.100
  • Svelte 3.9.1 (repl)

Severity would seem relatively high as I'm not sure how you would easily correct the behavior.

Thanks for the amazing work. Svelte is awesome!

@Conduitry Conduitry added the bug label Aug 29, 2019
@dxlbnl
Copy link
Contributor

dxlbnl commented Nov 15, 2019

@chrisbrown-io
Copy link

I've also ran into the same issue. Initially thought it might have something to do with nested store subscriptions, but the same is present just when passing local reactive variables down through components:

https://svelte.dev/repl/b7d4de8f20634d47a42fd621b689938b?version=3.15.0
(A, B, C are using writeable stores, whereas D, E, F are using local vars).

@hamilton
Copy link

@Conduitry did this get fixed with #4091? Seems to be the case on my end.

@Conduitry
Copy link
Member

Yep, thanks, looks like #4061 was a duplicate of this, and it's fixed now. Closing.

@chrisbrown-io
Copy link

chrisbrown-io commented Dec 16, 2019

Seems like the fix has only solved the issue when the nesting/component hierarchy is 1 level deep (see REPL for example). In this example you would expect all <A>, <B>, <C> and <D> slot vars to update.

This is probably an extreme example, but you would expect this to work within slotted components. You can see the effect of this by comparing the above REPL and this edited version that has an empty component that renders a <slot /> which in turn breaks the updates.

Not familiar with the svelte source in the slightest, but will dig into the PR that addressed this issue and see if there is anything obvious!

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

No branches or pull requests

5 participants