-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that the turbo-frame header is not sent when the turbo-frame h…
…as a target of _top (#1138) * Ensure that the turbo-frame header is not sent when the turbo-frame has a target of _top Given an HTML structure like this: ```html <turbo-frame id="frame" target="_top"> <a href="/src/tests/fixtures/prefetched.html">Hover to prefetch me</a> </turbo-frame> ``` When the user hovers over the link, the turbo-frame header should not be sent in a prefetch request because the wrapping turbo-frame has a target of `_top`. If we don't respect this turbo-rails sees the turbo-frame header and renders a turbo-frame response with a minimal layout that doesn't include any assets in the head. When turbo processes the response it may find a missmatch in tracked assets and cause a reload. * Prefer `getAttribute` over `dataset` for `data-turbo-frame` attribute
- Loading branch information
Alberto Fernández-Capel
authored
Jan 24, 2024
1 parent
95c98d4
commit 5902f3b
Showing
3 changed files
with
37 additions
and
10 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
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