-
Notifications
You must be signed in to change notification settings - Fork 437
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
Turbo Stream operations ignore [data-turbo-permanent]
#623
Comments
I think it makes sense for permanent elements to survive stream actions. If you DON'T want a permanent element to survive, you can always just not mark it permanent in the stream content. |
Closes hotwired#623 Refactor the `Snapshot` implementation to make the permanent element finding code re-usable outside that module. Then, introduce the `StreamMessageRenderer` class, and re-use that code. The `StreamMessageRenderer` class also implements `BardoDelegate`, and relies on `Bardo.preservingPermanentElements` to manage elements across their `<turbo-stream>` rendering lifespan.
Closes hotwired#623 Refactor the `Snapshot` implementation to make the permanent element finding code re-usable outside that module. Then, introduce the `StreamMessageRenderer` class, and re-use that code. The `StreamMessageRenderer` class also implements `BardoDelegate`, and relies on `Bardo.preservingPermanentElements` to manage elements across their `<turbo-stream>` rendering lifespan.
Is it on the roadmap for data-turbo-permanent to work with StreamActions? I'd like to be able to implement this on an input file, to avoid having to re-upload the file after a 422 response. |
Related to #622 (comment).
Unlike the PageRenderer and FrameRenderer implementations, the StreamActions do not preserve permanent elements
You can experiment with the code on JSFiddle:
Is this intended behavior? Permanent elements are a Turbolinks concept, and pre-date Frames and Streams.
Personally, I'm not sure what I'd expect to be "correct" behavior.
On one side of the argument, "permanence" is meaningful during navigation, but might not fit the idea of a Stream operation. On the opposing side, "permanence" could implies that it should be sturdy enough to be immutable in the face of page updates.
The text was updated successfully, but these errors were encountered: