-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Form Link Submissions: Don't remove
<form>
until submission is comp…
…lete (#678) * Improve flaky Frame Test Instead of timing frame navigations by beat, use `nextEventOnTarget`, target the frame, then assert about its header text content. * Form Link Submissions: Don't remove `<form>` until submission is complete When an `<a>` element annotated with `[data-turbo-method]` is clicked, Turbo Drive creates, appends, submits, and removes a `<form>` element behind the scenes. Unfortunately, prior to this commit, the `<form>` element is submitted then removed synchronously and immediately. This means that by the time the `submit` events (and resulting `turbo:before-fetch-request` and `turbo:submit-start` events) bubble up through the document, the `<form>` element is already disconnected. In its absence, the `document.documentElement` serves as the event's target. This commit changes that process to defer the elements removal until _after_ it dispatches a `turbo:submit-end` event. The result is that the element is present throughout all the events, and is accessible through `event.target`.
- Loading branch information
1 parent
b1eed57
commit 28a5dc4
Showing
5 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters