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

Remove disclaimer for data-turbo-method not working in forms #142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

julianfssen
Copy link

The Turbo handbook mentions that data-turbo-method does not work in forms as it generates a hidden form which is invalid HTML.

While working on a separate Rails PR, I discovered that when the data-turbo-method attribute is present, turbo actually appends the hidden form to document.body instead of nesting it in the parent form which makes it "work":

https://github.com/hotwired/turbo/blob/main/src/observers/form_link_click_observer.ts#L63

It doesn't feel right to have a non-GET link in a form. But, I also think it makes sense to remove the disclaimer as it's not accurate.

Please correct me or close this PR if I understood the data-turbo-method implementation wrongly. Thank you!

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.

1 participant