-
Notifications
You must be signed in to change notification settings - Fork 13
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(Indeterminate Checkbox): Fixed issue with voice over not recognizing the mixed state when using keyboard navigation. #1652
base: dev
Are you sure you want to change the base?
Conversation
π¦ Changeset detectedLatest commit: bace366 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
π Deployed on https://docs-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
π Deployed on https://storybook-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
) : isChecked ? ( | ||
<CheckBoxIcon size={theme.iconSizes.medium} /> | ||
<div | ||
tabIndex={!disabled && 0} |
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.
I'm not sure about this tabindex here. It's changing the keyboard navigation behavior in TreeView which we don't want. Speaking of which, we should note in the testing notes to consider TreeView and DataGrid
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.
I removed the div and moved these attributes to StyledFakeInput
.
<div | ||
tabIndex={!disabled && 0} | ||
role="checkbox" | ||
aria-checked="mixed" |
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.
When we add this, we now have an input with aria-checked mixed AND a div with it. Is this okay? How do other systems handle this?
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.
Also, this mixed status is hardcoded so even when it becomes checked, mixed
is still in the dom.
π Deployed on https://docs-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
π Deployed on https://storybook-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
π Deployed on https://docs-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
π Deployed on https://storybook-preview-1652--upbeat-sinoussi-f675aa.netlify.app |
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.
-
Having tabIndex here still breaks the keyboard navigation in TreeView. With TreeView, we expect
Tab key moves to the tree and then out of the tree
and the tree should be navigated with up and down arrows. -
The focus around the indeterminate checkbox looks weird/different to the focus around regular checkboxes
-
Have you found a good example in the wild that does what we are trying to do? That will help us ensure we are doing this the right way.
@@ -172,6 +185,10 @@ export const IndeterminateCheckbox = React.forwardRef< | |||
style={inputStyle} | |||
theme={theme} | |||
aria-hidden="true" | |||
tabIndex={0} | |||
role="checkbox" | |||
aria-checked={isIndeterminate ? 'mixed' : isChecked} |
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.
Is it okay to have aria-checked twice? If it is, we can copy line 153 aria-checked={ariaCheckedValue}
.
We have type="checkbox"
on the hidden input so I worry this is repetitive??
Closes #1231
π’ What I did π’
Restructured DOM to recognize the "mixed" state when Voice Over tabs over indeterminate checkboxes
πΊ Screenshots: πΊ
β Checklist β
π How to test π