-
Notifications
You must be signed in to change notification settings - Fork 752
Closed
Description
Components on the current page are not unmounted when navigating to a page cached by Turbolinks (e.g. back button).
Events for an initial page load:
page:change
<-- components are mounted
Events for a normal page visit (e.g. clicking a link):
page:before-change
<-- components are unmounted here...page:fetch
page:receive
<-- ...or here with When using turbolinks, unmount components just before loading the new page #85page:change
<-- components are mountedpage:load
Events for a cached page (e.g. back button):
page:change
<-- components are mountedpage:restore
As you can see, neither of the unmount events are fired for cached pages.
My initial though was to unmount on page:change
and mount on both page:load
and page:restore
, but this obviously won't work for the initial page load.
The only solution I can currently think of is to turn off Turbolinks caching via Turbolinks.pagesCached(0)
Metadata
Metadata
Assignees
Labels
No labels