Skip to content
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

Fix frame not advancing when using Turbo.visit #940

Closed

Conversation

pythonandchips
Copy link
Contributor

When you have a frame with data-trubo-action attribute and use Turbo.visit({frame: "frame-id"}) to navigate the frame the action is ignored and the url does not change. The url will change if a link was click prior to the Turbo.visit. Below is a gif demonstrating the issue.

turbo-bug-repo
(the example code can been seen in https://github.com/fac/turbo-frame-visit-bug-reproduction)

This appears to happen as the visit method of the frame does not set the action on the FrameController as it does in the proposeVisitIfNavigatedWithAction.

To fix this I've set the action property on the frame in the visit method.

I've not had much luck writing a test for this so any help or pointers in writing a test would be much appreciated.

When you have a frame with `data-trubo-action` attribute and use
`Turbo.visit({frame: "frame-id"})` to navigate the frame the action is
ignored and the url does not change.

This appears to happen as the `visit` method of the frame does not set
the `action` on the `FrameController` as it does in the
`proposeVisitIfNavigatedWithAction`.

To fix this I've set the `action` property on the frame in the visit
method.
@pythonandchips pythonandchips force-pushed the bug/fix-visit-navigation-with-action branch from 276245d to 6915c54 Compare July 6, 2023 14:04
@brunoprietog
Copy link
Collaborator

Thanks! This was already addressed in #1135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants