turbo: Missing Turbo-Frame header when submitting a form
When clicking links while inside a frame, the Turbo-Frame
header will be set.
This helps the backend to know this is a frame request and for instance to not render layout.
When submitting a form, this header is not set, I think it should be.
Example : To respect progressive enhancement, we should be able to return a frame when the request comes from turbo, but perform a redirection when not.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 16 (9 by maintainers)
Commits related to this issue
- Append form delegates header to form header request #86 — committed to tleish/turbo by tleish 3 years ago
- Recursively prepare fetch headers Closes https://github.com/hotwired/turbo/issues/86 Recursively walk the tree of dependent FetchRequestDelegates so that they all have an opportunity to modify the f... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Recursively prepare fetch headers Closes https://github.com/hotwired/turbo/issues/86 Recursively walk the tree of dependent FetchRequestDelegates so that they all have an opportunity to modify the f... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Recursively prepare fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 Recursively walk the tree of dependent FetchRequestDelegates so... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Recursively prepare fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 Recursively walk the tree of dependent FetchRequestDelegates so... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Prepare Frame Form Submission fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 When submitting a Form that is within a `<turbo-frame... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Prepare Frame Form Submission fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 When submitting a Form that is within a `<turbo-frame... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
- Prepare Frame Form Submission fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 When submitting a Form that is within a `<turbo-frame... — committed to hotwired/turbo by seanpdoyle 3 years ago
- Prepare Frame Form Submission fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 When submitting a Form that is within a `<turbo-frame... — committed to hotwired/turbo by seanpdoyle 3 years ago
- Prepare Frame Form Submission fetch headers Closes https://github.com/hotwired/turbo/issues/86 Closes https://github.com/hotwired/turbo/pull/110 When submitting a Form that is within a `<turbo-frame... — committed to seanpdoyle/turbo by seanpdoyle 3 years ago
@seanpdoyle using beta 4. Turbo header is not sent with POST request, only GET.
Ah. I did not realize this was intentional. I also didn’t realize I could not use turbo-stream with a GET method.
I am still experiencing the issue in beta-4.
GET (links) send the header. POST (form submissions) do not.
In the following example, only the first GET button will include a request header with
Turbo-Frame
, the other 2 do not include it in the header.Is this intended or a bug?
using:
@hotwired/turbo 7.0.0-beta.3
Sorry if it wasn’t clear, I was advocating to set the
Turbo-Frame
header only when a form within a frame is being submitted