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

Clarify what refresh="morph" does on turbo-frames & correct the examples #170

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

krschacht
Copy link

@krschacht krschacht commented Feb 19, 2024

Update the two examples of turbo-frame with refresh="morph" so they are correct. This relates to PR hotwired/turbo#1192 but it can be merged in without it since the clarifications are correct regardless of this other PR.

@krschacht krschacht changed the title Correct the example use of turbo-frame when explaining page morphing Clarify what refresh="morph" does on turbo-frames & correct the example Feb 19, 2024
@@ -52,8 +52,7 @@ Sometimes, you want to ignore certain elements while morphing. For example, you
You can use [turbo frames](/handbook/frames.html) to define regions in your screen that will get reloaded using morphing when a page refresh happens. To do so, you must flag those frames with `refresh="morph"`.

```html
<turbo-frame id="my-frame" refresh="morph">
...
<turbo-frame id="my-frame" refresh="morph" src="/my_frame">
</turbo-frame>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refresh="morph" has no effect when there is no src on the turbo-frame. Updating this example so it's consistent with the statements below:

"...you can load additional content that didn't arrive in the initial page load ..." and "When a page refresh happens, Turbo won't remove the frame contents; instead, it will reload the turbo frame ..."

@krschacht krschacht changed the title Clarify what refresh="morph" does on turbo-frames & correct the example Clarify what refresh="morph" does on turbo-frames & correct the examples Feb 19, 2024
krschacht and others added 2 commits February 20, 2024 10:56
Co-authored-by: Sean Doyle <seanpdoyle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants