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

Allow form buttons to be disabled on click via data-disable-with #2164

Merged
merged 4 commits into from
Jul 31, 2023

Conversation

camertron
Copy link
Contributor

@camertron camertron commented Jul 27, 2023

What are you trying to accomplish?

I was recently reading a discussion on Slack and realized the Primer forms framework does not support Rails' data-disable-with functionality. In fact, the framework explicitly disallows it by deleting the data-disable-with attribute if it is applied to a button. My intent here was to disallow the disabled attribute, since form buttons should never be disabled according to our guidelines. The data-disable-with attribute is nice to have because it prevents forms from being submitted multiple times. This PR restores data-disable-with and removes disabled attributes instead.

Integration

No changes required in production.

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

Accessibility

  • No new axe scan violation - This change does not introduce any new axe scan violations.

Merge checklist

  • Added/updated tests
  • Added/updated previews (Lookbook)

@changeset-bot
Copy link

changeset-bot bot commented Jul 27, 2023

🦋 Changeset detected

Latest commit: 45f2c45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@camertron camertron temporarily deployed to preview July 27, 2023 21:48 — with GitHub Actions Inactive
@camertron camertron temporarily deployed to github-pages July 27, 2023 21:53 — with GitHub Actions Inactive
@camertron camertron merged commit 9334445 into main Jul 31, 2023
29 checks passed
@camertron camertron deleted the form_buttons_disable_with branch July 31, 2023 17:23
@primer-css primer-css mentioned this pull request Jul 31, 2023
@camertron camertron mentioned this pull request Aug 2, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants