-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore attribute "refresh=morph" to flag turbo frames to reload duri…
…ng a page refresh. This adds a new turbo-frame attribute: `refresh`. When its value is `morph`: * It will reload the turbo frame with morphing during a page refresh. * It won't update the turbo frame with the server response. * It won't remove it if it's missing in the server response. This attribute was part of the original proposal we presented in Rails World, then we removed it [1], because we thought it wasn't needed. But after testing the library in different scenarios, we've found assuming certain behavior for all the remote frames was problematic since it implied being too clever about what you wanted to do with the frame. The new attribute makes for a simple behavior: * The default behavior will be the expected one: turbo frames will be morphed as any other element. If they get a new URL they will be reloadded, if the get deleted in the response, they will disappear, etc. * You can use the new attribute to flag the frames for which you want the special behavior. [1]: 0c6a95d
- Loading branch information
1 parent
a247b35
commit 9ff6e16
Showing
6 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<turbo-frame id="remote-frame"> | ||
<turbo-frame id="refresh-morph"> | ||
<h2>Loaded morphed frame</h2> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<turbo-frame id="refresh-reload"> | ||
<h2>Loaded reloadable frame</h2> | ||
</turbo-frame> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters