forked from hotwired/turbo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Promoting lazy-loaded Frames (hotwired#790)
Prior to this commit, `<turbo-frame>` elements navigated via the `AppearanceObserver` (powered by the [loading=lazy][] attribute) were not accounting for their [data-turbo-action][] attributes. To resolve that issue, this commit changes the `AppearanceObserver` and `AppearanceObserverDelegate` to utilize a parameterized `<T extends Element>` type so that the delegate callbacks can be invoked with `FrameElement` references. With those changes in place, this commit changes the `FrameController.elementAppearedInViewport` callback's invocation to prepare a `PageSnapshot` and attempt to `proposeVisitIfNavigatedWithAction`. [loading=lazy]: https://turbo.hotwired.dev/reference/frames#lazy-loaded-frame [data-turbo-action]: https://turbo.hotwired.dev/reference/frames#frame-that-promotes-navigations-to-visits
- Loading branch information
1 parent
22fd88a
commit 00b287a
Showing
4 changed files
with
31 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
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