Skip to content

Commit

Permalink
TreeView: Use roving tabIndex for focus management (#2443)
Browse files Browse the repository at this point in the history
* Swap active descendant implementation for roving tabindex (wip)

Co-authored-by: Josh Black <joshblack@users.noreply.github.com>

* Remove active descendant from loading focus logic

* Remove active descendant code and fix build errors

* Add typeahead

* Update level indicator line logic

* useActiveDescendant -> useRovingTabIndex

* Remove unnecessary styles

* Document ref props

* Forward ref to LinkItem

* Create wise-keys-drum.md

* Remove active descendant from tests

* Update toggle on enter

Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
  • Loading branch information
colebemis and joshblack authored Oct 18, 2022
1 parent 38bb276 commit 3012fae
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 533 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-keys-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

TreeView: Use roving tabindex instead of `aria-activedescendant` for improved VoiceOver support in Safari
6 changes: 2 additions & 4 deletions docs/content/TreeView.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ See [Storybook](https://primer.style/react/storybook?path=/story/components-tree
name="onSelect"
type="(event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void"
/>
<PropsTableRefRow refType="HTMLElement" />
{/* <PropsTableSxRow /> */}
</PropsTable>

Expand Down Expand Up @@ -267,13 +268,10 @@ See [Storybook](https://primer.style/react/storybook?path=/story/components-tree
name="onSelect"
type="(event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void"
/>
<PropsTableRefRow refType="HTMLElement" />
{/* <PropsTableSxRow /> */}
</PropsTable>

### TreeView.LoadingItem

<PropsTable>{/* <PropsTableSxRow /> */}</PropsTable>

### TreeView.SubTree

<PropsTable>
Expand Down
Loading

0 comments on commit 3012fae

Please sign in to comment.