-
-
Couldn't load subscription status.
- Fork 4.7k
Closed
Description
Describe the bug
I found two problems with reactivity with the style:property directive.
- The style directive is not reactive when used with a function.
Example :
<div style:background-color={getColor()}>1</div>I think that the $.style() should be inside a $.render_effect(), but this is not the case.
- All the style-directives of an element are re-rendered when one of the state change.
<div style:background-color={color} style:color={randomColor()}>2</div>randomColor() is not a reactive function, but it's called when the color state is updated.
All the $.style() are inside the same $.render_effect().
I think they should have separate calls...
Perhaps all the $.style() should be called directly, and the $.render_effect() be called inside the $.style() function.
Reproduction
See REPL
Logs
No response
System Info
REPLSeverity
annoyance
brunnerh, navorite, hanszoons and aradalvand
Metadata
Metadata
Assignees
Labels
No labels