-
Notifications
You must be signed in to change notification settings - Fork 21
SplitButton needs label #154
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
base: main
Are you sure you want to change the base?
Conversation
| // Unlabeled SplitButton | ||
| { | ||
| code: ` | ||
| <SplitButton>Example</SplitButton> |
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.
this is actually valid
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.
The SplitButton component is a unique type of a button. Here are the valid ways to have an accessible SplitButton:
- It has text content. If it has any text content at all, then it is accessible even if it has an icon.
e.g.
<SplitButton
menuButton={triggerProps}
primaryActionButton={primaryActionButtonProps}
icon={}
>
Example
<SplitButton
menuButton={triggerProps}
primaryActionButton={primaryActionButtonProps}
>
Example
</SplitButton>
-
If it does not have text content, then we must label the primary action button and not the SplitButton itself.
<SplitButton menuButton={triggerProps} primaryActionButton={{ ref: setPrimaryActionButtonRef, "aria-label": "With calendar icon only", }} icon={<CalendarMonthRegular />} />
We would need to adjust our ruleFactory to take in a custom checker function.
aria-label, aria-labelledby, htmlFor, aria-describedby, Label, Field and Tooltip are not valid ways to label the SplitButton.
Thank you @aubreyquinn. I have updated rule accordingly. |
Updated to use factory rule |
Added new rule for SplitButton to have an accessible name
Issue- #45