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

"Vanilla" DOM removes and recreates a text node when changing the text content #417

Open
lemonmade opened this issue Aug 16, 2024 · 1 comment
Assignees

Comments

@lemonmade
Copy link
Member

When not using the BatchingRemoteConnection object, this can sometimes lead to a very subtle "flickering", as the remove message and append messages are handled asynchronously from one another on the host.

@lemonmade lemonmade self-assigned this Aug 19, 2024
@lemonmade
Copy link
Member Author

This is most noticeable when replacing the entire text content of another element, e.g.:

const button = document.createElement('ui-button');
button.textContent = '0 seconds passed';

let seconds = 0;
setInterval(() => {
  seconds += 1;
  button.textContent = `${seconds} seconds passed`;
}, 1000);

This happens because this operation removes all current children of the element, before creating a new text element with the updated content as the only child. This can be addressed with BatchingRemoteConnection, but I should either make it automatic or document this requirement better...

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

1 participant