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

Updates to text nodes caused by signal changes are not hightlighted #472

Open
nicolo-ribaudo opened this issue Mar 16, 2023 · 2 comments
Open

Comments

@nicolo-ribaudo
Copy link

Demo:

const s = signal(0);

function inc() {
  s.value++;
}

export default function App() {
  return html`
    ${s}
    <button onclick=${inc}>Increment</button>
  `;
}

When "Highlight updates" is enabled, I would expect the number to be highlighted every time it changes because I click on the button.

Screen.Recording.2023-03-16.at.12.51.00.mov
@richbayliss
Copy link

I don't think it should... since your using the templated value {inc} this is an optimized mechanism that doesn't re-render the component. Change it to {inc.value} and you will see it update, as this DOES cause the re-render 👍🏻

@nicolo-ribaudo
Copy link
Author

The component is not re-rendered, but the text node is.

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

No branches or pull requests

2 participants