Closed rathboma closed 2 years ago
Thank you for opening this issue!
Is this potentially a duplicate of #617, which might be resolved by https://github.com/hotwired/turbo/pull/618? #618 is merged, but not yet released.
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
I've just tested this locally to confirm that it has been resolved by https://github.com/hotwired/turbo/pull/618.
It's covered by a test that makes the same check during the turbo:frame-render
event, which is dispatched before the turbo:frame-load
event.
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: