turbo: data-turbo-action="advance" doesn't update browser URL
The documentation says that the browser URL will be updated if data-turbo-action="advance"
is set on a link or a turbo frame.
Unfortunately, only the src
attribute of the turbo frame is updated.
When using Turbo.visit()
, the src
attribute and the browser url are updated.
I’m using version 7.0.1.
Is this related to #468?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 17 (3 by maintainers)
Commits related to this issue
- Add test coverage for driving `turbo-frame[data-turbo-action]` Closes [#489][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" target="frame">` as ou... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Add test coverage for driving `turbo-frame[data-turbo-action]` Closes [#489][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" target="frame">` as ou... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Add test coverage for driving `turbo-frame[data-turbo-action]` Closes [#489][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" target="frame">` as ou... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Add test coverage for driving `turbo-frame[data-turbo-action]` Closes [#489][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" target="frame">` as ou... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Add test coverage for driving `turbo-frame[data-turbo-action]` Closes [#489][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" target="frame">` as ou... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Drive `turbo-frame` with `Turbo.visit(url, { frame:, action: })` Closes [#489][] Closes [#468][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" targ... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Drive `turbo-frame` with `Turbo.visit(url, { frame:, action: })` Closes [#489][] Closes [#468][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" targ... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Drive `turbo-frame` with `Turbo.visit(url, { frame:, action: })` Closes [#489][] Closes [#468][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id="hello" targ... — committed to seanpdoyle/turbo by seanpdoyle 5 months ago
- Drive `turbo-frame` with `Turbo.visit(url, { frame:, action: })` (#1135) Closes [#489][] Closes [#468][] First, add test coverage to exercise the `<turbo-frame id="frame">` and `<turbo-frame id=... — committed to hotwired/turbo by seanpdoyle 5 months ago
@dhh @seanpdoyle this issue is regressed since 7.3.0, can we get this issue back open?
Are we sure this is working? I’m creating a fresh Rails 7 application, have included
stimulus-rails
andturbo-rails
inGemfile
andpackage.json
contains"@hotwired/turbo-rails": "latest"
under"dependencies"
.yarn.lock
indicates I’m using 7.1.3 of@hotwired/turbo
.My view contains
<turbo-frame data-turbo-action="advance" id="header" target="main"><a href="..."></a></turbo-frame>
and further a<turbo-frame id="main"></turbo-frame>
. I would expect the page’s URL to change when clicking the link.Same for me, I’m using
"@hotwired/turbo-rails": "^7.3.0",
andTurbo.visit('/...', { frame: 'results', action: 'advance' })
doesn’t update URL of the pageI’d expect the following to update my URL but it doesn’t 😦
Turbo.visit(url, { frame: 'a', action: 'advance' })
As a workaround, I added a controller to my rendered html that when connected passes values for the page name and path I want to set
I suspect this issue was introduced here, as before this change
options
were taken into account, but not any longer after that change. AndTurbo.visit
lands here. cc @seanpdoylewhen i manually update the src attribute of a frame with “data-turbo-action” set to “advance” the url doesn’t change. I’m missing something ? When i click a link inside a frame everything is working as expected.
I’ve added test coverage to https://github.com/hotwired/turbo/pull/1135 to attempt to resolve this issue. Unfortunately, I was able to pass the test without any implementation changes. Could you review that diff (mainly https://github.com/hotwired/turbo/pull/1135/files#diff-1e84a1526802b27615a24efc0f9b75c27b2a9197d855a8ccc5475db14609ed6f and https://github.com/hotwired/turbo/pull/1135/files#diff-4706705ec52e666c36d3cd9410d3aad96354c69f61a18f880b40291836485f36R655-R663 to help me reproduce the underlying issue more closely?
May or not be related, but I’m experiencing a similar issue even without manually setting
action: 'advance'
:Updates the
src
attribute on the frame but does not update the URL."@hotwired/turbo": "^7.3.0"
Solved changing package.json to
"@hotwired/turbo-rails": "^7.1.0"
and runyarn upgrade turbo