Skip to content

fix(button): reflect loading state in aria-disabled - #967

Open
zigzagdev wants to merge 3 commits into
gympass:masterfrom
zigzagdev:fix/button-aria-disabled-loading-state
Open

zigzagdev wants to merge 3 commits into
gympass:masterfrom
zigzagdev:fix/button-aria-disabled-loading-state

Conversation

@zigzagdev

@zigzagdev zigzagdev commented Sep 6, 2026

Copy link
Copy Markdown

JIRA Issue

Description 📄

[Enter the description of your changes]

The disabled HTML attribute on Button already accounted for isLoading (disabled={disabled || isLoading}), but aria-disabled only reflected the disabled prop.
Screen reader users could be told a loading button was still interactive.
Updated aria-disabled to also reflect isLoading, falling back to undefined when neither disabled nor isLoading is set so the attribute is omitted in the default case, matching prior behavior.

Platforms 📲

  • Web
  • Mobile

Type of change 🔍

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? 🧪

[Enter the tips to test this PR]

Added a regression test asserting the rendered button has aria-disabled="true" while isLoading is true, even without an explicit disabled prop.
Ran the full Button test suite locally — all 146 tests pass; 34 pre-existing "Loading" snapshots were updated to include the new aria-disabled="true" attribute, and no other snapshots changed.

  • Unit Test
  • Snapshot Test

Checklist: 🔍

  • My code follows the contribution guide of this project Contributing Guide
  • Layout matches design prototype: FIGMA
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Screenshots 📸

[Upload your screenshots here]

N/A

Before After

The disabled HTML attribute already accounted for isLoading, but
aria-disabled only reflected the disabled prop. Screen reader users
could be told a loading button was still interactive. Fall back to
undefined when neither disabled nor isLoading is set so the attribute
is omitted in the default case, matching prior behavior.
Add a regression test asserting the rendered button has
aria-disabled="true" while isLoading is true, even without an
explicit disabled prop.
@zigzagdev zigzagdev changed the title fix(button): reflect loading state in aria-disabled fix(button): reflect loading state in aria-disabled Sep 6, 2026

This branch has not been deployed

No deployments
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.

1 participant