-
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
nested frames with a form will not redirect #396
Comments
I've been having exactly the same problem. I've tried applying If If |
In my case, the nesting of the frames is necessary because the route with the form is loaded using the |
This Stimulus controller I wrote should work as a stopgap in the meantime: /* form_controller.js */
import { Controller } from "stimulus"
import * as Turbo from "@hotwired/turbo"
export default class extends Controller {
static values = { next: String }
connect() {
this.element.addEventListener("turbo:submit-end", (event) => {
this.next(event)
})
}
next(event) {
if (event.detail.success) {
Turbo.visit(event.detail.fetchResponse.response.url)
}
}
} If it's just the frame you want to redirect, you should be able to adapt it to change the turbo frame As I said, this is a stopgap, though. |
@boardfish My use case is exactly the same, using the outer frame to do lazy loading with the src attribute. |
#399 for an explanation of the problem and a suggested PR |
This issue can now be closed. I've successfully got the case outlined by @jcoyne to work with Turbo 7.0.1. |
Thanks for the fix, @tleish and co.! |
Given I have a template that looks like this:
And my server responds with a 302 redirect.
Then the page does not redirect on form submission and I see this error in the javascript console:
If I remove the outer containing turbo-frame, then it works as expected.
The text was updated successfully, but these errors were encountered: