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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions _source/handbook/03_page_refreshes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..."

```

Expand Down
5 changes: 2 additions & 3 deletions _source/reference/frames.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ Like an eager-loaded frame, but the content is not loaded from `src` until the f
</turbo-frame>
```

## Frame that will get reloaded with morphing during page refreshes
## Frame that will get reloaded with morphing during page refreshes & when they are explicitly reloaded with .reload()

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

Expand Down