-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a frame to navigate to previous url #263
Conversation
I might think you would want this use the following change instead to ensure that set sourceURL(sourceURL: string | undefined) {
this.settingSourceURL = true
this.element.src = sourceURL ?? null
+ this.currentURL = this.element.src
this.settingSourceURL = false
} |
318ada9
to
bd41770
Compare
Good idea. Updated. (Not like this is ever going to be merged) Thanks for pointing that out. 👍 |
Thanks for this, it looks like it fixes #265 too. |
For those needing this fix until its merged, I have published it as separate npm package here if anyone needs it. |
I successfully tested on our stack with @acetinick 's module, the revisit problem seems to be gone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I patched this PR into my local code and I can also confirm that it fixed the bug ❤️
Hope it get merged soon! |
To be perfectly honest, at this point probably DHH is the only one left with merge and release powers for this repo. So the odds of this (or any future releases of turbo) are pretty slim at this point. |
Thank you for the status report. I was thinking of waiting, but finally I'll fork it out while waiting for the official support. |
@dhh would you be able to review and merge this PR? It's quite a critical bug that is affecting lots of people. Thanks |
Updated the PR description to better outline what the bug is and why this change is needed. |
bd41770
to
46b15bc
Compare
Thanks for working on this @t27duck. I'll get this merged and cut a new release shortly. |
Fix included in beta 7 that was just released 👍 |
This is my attempt at a fix based on discussion and the previous PR as well as adding a test for it.
The gist: A frame will only update/make a request if
currentURL
andsourceURL
are different.currentURL
was not get updated properly so it was still pointing to the previous value. IfsourceURL
changes back to the original URL of the frame, the values would match and result in the frame not navigating.Example:
sourceURL
andcurrentURL
are set to "a"sourceURL
is updated,currentURL
is still "a". Frame navigates to "b".currentURL
was never changed to "b", navigation doesn't happen becausesourceURL
==currentURL
.Fixes #245
Fixes #249 (I presume)
Fixes #265 (Reported)