-
Notifications
You must be signed in to change notification settings - Fork 77
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(action): Add screen reader support for active
and indicator
props
#5875
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic improvement, @driskull! 🙌🏻
We're giving context when the indicator is added to the component on-the-fly. It's missing context if an indicator is already present on the component.
It provides instant feedback, which is a great improvement and good starting point for the component.
A few comments below regarding the indicatorMessage
prop, which would be awesome to have a default value assigned to it.
Not sure how we can do anything in this case. Do you know? |
If we have a default text value present in Very rough example where if present the value is read back with the const {
active,
compact,
disabled,
loading,
textEnabled,
label,
text,
indicator,
indicatorId,
indicatorMessage,
intlIndicator,
buttonId
} = this;
const indicatorPresent = indicator ? indicatorMessage ?? intlIndicator : "";
const ariaLabel = label + indicatorPresent || text + indicatorPresent; |
@geospatialem I could use a concatenated |
We'd still need the live region for providing context when the indicator is changed, so both would need to be present for context to AT users. Good call on the concatenation for language support, @driskull what if we used a template literal, such as: const indicatorStatus = indicator ? indicatorMessage ?? intlIndicator : "";
const ariaLabel = `${label} ${indicatorStatus}` || `${text} ${indicatorStatus}`; |
I can do that if we don't think it will be an issue to combine the two strings. |
@geospatialem can you test again? |
@driskull Looking great! 😎 JAWS transcript below, with a similar experience in NVDA, with If the indicator is present on load:
after the indicator is removed:
and after the indicator is added:
|
…components into dris0000/action-a11y-fixes
active
and indicator
properties. #4813active
and indicator
properties
active
and indicator
propertiesactive
and indicator
props
Ready for review. |
intlIndicator | ||
} = this; | ||
|
||
const ariaLabel = `${label || text}${indicator ? ` (${intlIndicator})` : ""}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to support built-in localization for aira-label , t9nComponent
interface should be implemented here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm. it will be covered here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Can you approve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
…5938) **Related Issue:** #4813 ## Summary Updates the action component's `indicator` and `intlIndicator` prop descriptions. cc: #5875, #5895 Co-authored-by: Ben Elan <[email protected]>
Related Issue: #4813
Summary
fix(action): Add screen reader support for
active
andindicator
properties. #4813aria-pressed
to describe toggle state foractive
propertyaria-live
region to describeUnsaved changes
forindicator
property