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

Allow Drive to submit a form when spot-enabled but submitter is null #406

Merged
merged 2 commits into from Sep 24, 2021

Conversation

terracatta
Copy link
Contributor

@terracatta terracatta commented Sep 24, 2021

Fixes #392

When you disable Turbo Drive wholesale with Turbo.session.drive = false and spot enable it on a form without a submit button with data-turbo=true Turbo Drive still wouldn't fire because it couldn't verify that the submitter (which was null) had a container where turbo was enabled.

This pulls in @willcosgrove's recommendation. The summary: it's wise to never assume the DOM placement and logic for a submitter that is null.

@dhh
Copy link
Member

dhh commented Sep 24, 2021

Would be good with a test for this.

@terracatta
Copy link
Contributor Author

Would be good with a test for this.

I agree. Working on it.

@terracatta terracatta force-pushed the jem_fix_turbo_enabled_attributes branch from a519e4f to 7774fe9 Compare September 24, 2021 17:44
@terracatta
Copy link
Contributor Author

@dhh Ok I have a working test that simulates @willcosgrove's initial situation. Let me know if you need anything else.

@dhh
Copy link
Member

dhh commented Sep 24, 2021

Boom!

@dhh dhh merged commit 157d423 into hotwired:main Sep 24, 2021
@terracatta terracatta deleted the jem_fix_turbo_enabled_attributes branch September 24, 2021 18:23
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.

Turbo not handling form submission when globally disabled but locally enabled and called with requestSubmit
2 participants