-
Notifications
You must be signed in to change notification settings - Fork 102
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
base: main
Are you sure you want to change the base?
Clarify what refresh="morph" does on turbo-frames & correct the examples #170
Conversation
@@ -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> |
There was a problem hiding this comment.
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 ..."
Co-authored-by: Sean Doyle <seanpdoyle@users.noreply.github.com>
Update the two examples of
turbo-frame
withrefresh="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.