We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
Svelte generates code that updates style properties when nothing could change.
To Reproduce
https://svelte.dev/repl/fa82902dbf5e442a92217e6d6fa6c078?version=3.8.1
Expected behavior
Given this code...
<script> let color = 'red'; </script> <h1 class={color} style="color: {color}">color: {color}</h1>
...no update could should be generated, since color could not change. This works correctly for regular attributes:
color
return { c() { h1 = element("h1"); t0 = text("color: "); t1 = text(color); attr(h1, "class", "" + null_to_empty(color) + " svelte-1fyrt1w"); set_style(h1, "color", color); }, m(target, anchor) { insert(target, h1, anchor); append(h1, t0); append(h1, t1); }, - p(changed, ctx) { - if (changed.color) { - set_style(h1, "color", color); - } - }, - + p: noop, i: noop, o: noop, d(detaching) { if (detaching) { detach(h1); } } };
Severity
Minor
The text was updated successfully, but these errors were encountered:
closed via #3439
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Svelte generates code that updates style properties when nothing could change.
To Reproduce
https://svelte.dev/repl/fa82902dbf5e442a92217e6d6fa6c078?version=3.8.1
Expected behavior
Given this code...
...no update could should be generated, since
color
could not change. This works correctly for regular attributes:Severity
Minor
The text was updated successfully, but these errors were encountered: