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

Changing text content of slotted items does not trigger change detection #274

Open
hudson-newey opened this issue Jan 21, 2025 · 0 comments
Labels
Architecture bug Something isn't working

Comments

@hudson-newey
Copy link
Member

Example

Changing the text content of a verification grids <template> after initialization will not cause the verification grid to update.


As far as I remember, Lit provides some slotted content reactivity but lacks full reactivity support (most likely to improve performance).

At the moment our AbstractComponent acts as a reactive controller for slotted content. Listening for the slotchange event and triggering a rendering cycle.

However, listening to the slotchange event doesn't cover circumstances where the attributes / properties / text of slotted content changes.

This means that if an attribute, property or text of a slotted element is changed, we currently do not trigger a re-render, sometimes causing an outdated DOM.


We should explore how we can make parent components update if certain attributes/properties/text content on slotted children update.

I don't want to re-render all parent components if any attribute/property/text on a slotted element updates because that could cause significant performance problems for deeply nested components.

@hudson-newey hudson-newey added bug Something isn't working Architecture labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant