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

Ignore UJS <a> clicks and <form> submissions #744

Merged
merged 4 commits into from
Oct 8, 2022

Commits on Sep 30, 2022

  1. Prevent double requests from within turbo-frame

    Closes hotwired#743
    
    The change in behavior can be traced back to [hotwired#412][].
    When the overlap between the `LinkInterceptor` and the
    `LinkClickObserver` were unified, the technique used by the
    `LinkInterceptor` to prevent duplicate event handlers from responding to
    the same `click` event was changed in a subtle way.
    
    In its place, this commit changes the `LinkClickObserver` and
    `FormSubmitObserver` to ignore `<a>` clicks and `<form>` submissions if
    they're annotated with `[data-remote="true"]`.
    
    To exercise these edge cases, this commit also adds a `ujs.html` fixture
    file along with a `ujs_tests.ts` module to cover situations when
    `@rails/ujs` and `@hotwired/turbo` co-exist.
    
    [hotwired#412]: hotwired#412
    seanpdoyle committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    5871173 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Revert "Replace LinkInterceptor with LinkClickObserver"

    This reverts commit 9bef653.
    seanpdoyle committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    c212ae7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa20fcd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ab5558a View commit details
    Browse the repository at this point in the history