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

[PLAY-1203] Default cancel and close button type to prevent submission #3273

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

thestephenmarshall
Copy link
Contributor

@thestephenmarshall thestephenmarshall commented Mar 22, 2024

What does this PR do?

When a form is used to wrap the Rails dialog kit block area content, any unspecified button element will submit the form. Only buttons specified with the type="submit" attribute should perform this function.

By defaulting the cancel and close (X) buttons in the Rails version of the kit, we can avoid this unintended side effect.

Screenshots: Screenshots to visualize your addition/change

  • Please see the kits/dialog/rails#complex example

How to test? Steps to confirm the desired behavior:

  1. Go to the aforementioned path on the review env
  2. Activate the modal
  3. Click either X or "Cancel"
  4. The form should not submit (page should not reload and there should be no ? at the end of the URL in the browser's address bar)

Checklist:

  • LABELS Add a label: enhancement, bug, improvement, new kit, deprecated, or breaking. See Changelog & Labels for details.
  • DEPLOY I have added the milano label to show I'm ready for a review.
  • TESTS I have added test coverage to my code.

@thestephenmarshall thestephenmarshall self-assigned this Mar 22, 2024
@thestephenmarshall thestephenmarshall added milano 20 MAX - Deploy this PR to a review environment via Milano bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) labels Mar 22, 2024
@thestephenmarshall thestephenmarshall marked this pull request as ready for review March 22, 2024 19:22
@thestephenmarshall thestephenmarshall requested review from a team as code owners March 22, 2024 19:22
Copy link

🎉 Congratulations on creating an Alpha Version!

Your Alpha for Ruby Gems is 13.21.0.pre.alpha.PLAY120322465

Your Alpha for NPM is 13.21.0-alpha.PLAY120322465

@nidaqg nidaqg added the Product Approved pending technical review, OK to merge to master label Mar 28, 2024
@nidaqg nidaqg added the Code Approved Approved by a Playbook Admin label Mar 28, 2024
@jasperfurniss jasperfurniss added this pull request to the merge queue Mar 29, 2024
Merged via the queue into master with commit a6b19d5 Mar 29, 2024
9 checks passed
@jasperfurniss jasperfurniss deleted the PLAY-1203-2 branch March 29, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) Code Approved Approved by a Playbook Admin milano 20 MAX - Deploy this PR to a review environment via Milano Product Approved pending technical review, OK to merge to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants