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

Form Link Submissions: Don't remove <form> until submission is complete #678

Merged
merged 2 commits into from Aug 11, 2022

Commits on Aug 10, 2022

  1. Improve flaky Frame Test

    Instead of timing frame navigations by beat, use `nextEventOnTarget`,
    target the frame, then assert about its header text content.
    seanpdoyle committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    f177ee7 View commit details
    Browse the repository at this point in the history
  2. Form Link Submissions: Don't remove <form> until submission is comp…

    …lete
    
    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`.
    seanpdoyle committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    1b30e2e View commit details
    Browse the repository at this point in the history