Skip to content

Add ignoreWhilePending to railsUjs

What does this MR do and why?

This MR addresses an issue identified in this comment !81516 (comment 857772067) which is similar to issues like #353376 (closed).

The new bootstrap modals can be triggered multiple times while the promise is pending and the modal hasn't been created yet. There's a new utility which can be used in this situation called ignoreWhilePending.

Screenshots or screen recordings

The Cancel button is tab focused and "Enter" is hit multiple times quickly.

Before After
Screencast_2022-02-28_15_37_23 Screencast_2022-02-28_15_38_43

How to set up and validate locally

Enable the :bootstrap_confirmation_modals feature flag

Feature.enable(:bootstrap_confirmation_modals)
  1. Sign into your local gdk
  2. Visit /flightjs/Flight/-/new/master/
  3. Enter a filename and some random file content
  4. Tab to the "Cancel" button
  5. Hit "Enter" multiple times quickly
  6. Only 1 cancel modal should appear at a time

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Paul Slaughter

Merge request reports

Loading