Skip to content

Append stream behaviour discrepancy #223

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

Open
mingan opened this issue May 27, 2025 · 0 comments
Open

Append stream behaviour discrepancy #223

mingan opened this issue May 27, 2025 · 0 comments

Comments

@mingan
Copy link

mingan commented May 27, 2025

The documented behaviour of an append stream suggests that elements with duplicate IDs are replaced

If the template's first element has an id that is already used by a direct child inside the container targeted by dom_id, it is replaced instead of appended.

where in fact the duplicate elements are removed and the new versions are appended:

https://github.com/hotwired/turbo/blob/bea2f48103ee4578167be2400dcf72451b9c110b/src/core/streams/stream_actions.js#L9-L11

This potentially leads to elements being reordered which is not apparent from the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant