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

style: directive not rective within {#each} loop #7136

Closed
chrisbrown-io opened this issue Jan 14, 2022 · 2 comments · Fixed by #7140
Closed

style: directive not rective within {#each} loop #7136

chrisbrown-io opened this issue Jan 14, 2022 · 2 comments · Fixed by #7140
Labels
bug compiler Changes relating to the compiler

Comments

@chrisbrown-io
Copy link

chrisbrown-io commented Jan 14, 2022

Describe the bug

It seems as if the only change to an elements attributes is a style: directive change within an {#each} block, that the style change doesn't get updated/propagated.

Interestingly, I've found if you also change the content of the element being rendered or another attribute of the element, the style: change is propogated correctly.

Without being too familiar of the internals of the reactivity, I would assume the style: directive isn't reactive within a loop?

Will have a look at the source/changes implemented in #5923 and see if I can implement a fix, although I'll be pretty much starting from scratch with regards to grok-ing the reactivity source. Any pointers would be ace!

Reproduction

https://svelte.dev/repl/6221482eb173402988e4493fcf2bbba1?version=3.46.1

Logs

No response

System Info

System:
  OS: macOS 12.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Memory: 1.23 GB / 16.00 GB
  Shell: 5.8 - /bin/zsh
Binaries:
  Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
  npm: 8.1.0 - ~/.nvm/versions/node/v17.0.1/bin/npm
Browsers:
  Chrome: 97.0.4692.71
  Firefox: 94.0.2
  Safari: 15.2
npmPackages:
  svelte: ^3.46.1 => 3.46.1

Severity

annoyance

@dummdidumm dummdidumm added bug compiler Changes relating to the compiler labels Jan 14, 2022
@Conduitry
Copy link
Member

@PaulMaly
Copy link
Contributor

PaulMaly commented Feb 5, 2022

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

Successfully merging a pull request may close this issue.

4 participants