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

fix(button): add check for workingLabel to GenericButton for aria-live #39

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

mcwinter07
Copy link
Contributor

Why

A fix for an Intopia a11y issue - working (loading) buttons not announce a change to inner content - caused a separate problem with screen readers announcing button on page load. This was called out by Kevin here.

This was because the aria attribute was place on the top level of the GenericButton, which applied it to all buttons, whether they did or didn't use the "working" state.

What

  • A conditional check has been added only render the container with aria-live="polite" if a workingLabel is provided
    • workingLabel was used as working could be falsey
  • Adds tests to ensure coverage across the different button types

@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2023

🦋 Changeset detected

Latest commit: 31ddec0

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

This PR includes changesets to release 1 package
Name Type
@kaizen/button 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

@mcwinter07 mcwinter07 force-pushed the KDS-1810/fix-aria-polite-working-state branch from 2fa832a to e7d99ac Compare September 27, 2023 04:04
@mcwinter07 mcwinter07 marked this pull request as ready for review September 27, 2023 04:09
@mcwinter07 mcwinter07 requested a review from a team as a code owner September 27, 2023 04:09
@gyfchong gyfchong enabled auto-merge (squash) September 27, 2023 04:14
@github-actions
Copy link
Contributor

✨ Here is your branch preview! ✨

Last updated for commit 31ddec0: Merge branch 'main' into KDS-1810/fix-aria-polite-working-state

@gyfchong gyfchong merged commit d1615e5 into main Sep 27, 2023
28 checks passed
@gyfchong gyfchong deleted the KDS-1810/fix-aria-polite-working-state branch September 27, 2023 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants