You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To perform some actions when the turbo frame has finished loading and the URL has changed is currently not possible.
When turbo-frame-load fires, the window.location has not yet been updated, so checking window.location.* still gives the old URL.
Steps to reproduce:
functionlogEvent(event){console.log("comparing src vs window:",event.target.src,window.location.href))document.documentElement.addEventListener('turbo:frame-load',logEvent)
The text was updated successfully, but these errors were encountered:
rathboma
changed the title
BUG: The turbo:frame-load event is fired before the URL changes when using turbo-action="advance"
BUG: The turbo:frame-load event is fired before window.location is updated when using turbo-action="advance"
Jul 27, 2022
I checked out the issue. It's similar but not exactly the same -- regardless of whether you change location before or after rendering, certainly it should be changed before turbo:frame-load fires.
That fix might fix it, I have a hard time knowing -- does that change the behavior to address #617? If so it probably will
To perform some actions when the turbo frame has finished loading and the URL has changed is currently not possible.
When
turbo-frame-load
fires, thewindow.location
has not yet been updated, so checkingwindow.location.*
still gives the old URL.Steps to reproduce:
The text was updated successfully, but these errors were encountered: