8000 fix(TreeView): improved a11y experience by thatblindgeye · Pull Request #6480 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

fix(TreeView): improved a11y experience#6480

Merged
mcoker merged 4 commits intopatternfly:mainfrom
thatblindgeye:iss6478_treeviewA11y
Apr 23, 2024
Merged

fix(TreeView): improved a11y experience#6480
mcoker merged 4 commits intopatternfly:mainfrom
thatblindgeye:iss6478_treeviewA11y

Conversation

@thatblindgeye
Copy link
Contributor

Closes #6478

@thatblindgeye thatblindgeye added the A11y Accessibility related issues label Mar 28, 2024
Comment on lines -876 to -877
### Accessibility

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section/table no longer needed with the a11y doc update being made in org.

@patternfly-build
Copy link
Collaborator
patternfly-build commented Mar 28, 2024

{{#if tree-view-list-item--IsExpandable}}
aria-expanded="{{#if tree-view-list-item--IsExpanded}}true{{else}}false{{/if}}"
{{#if tree-view-node--HasCheckbox}}
{{#if tree-view-list-item--HasCheckbox}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this was working as intended since the tree-view-node was a child of tree-view-list-item, so I just made this update to be able to pass things down to children.

Copy link
Contributor
@jessiehuff jessiehuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, but definitely defer to @mcoker's opinion!

@thatblindgeye
Copy link
Contributor Author
thatblindgeye commented Apr 2, 2024

@jessiehuff @mcoker The latest commit updates tabindices to match what is currently mentioned in the treeview a11y docs update PR. Basically only the first focusable item in each treeview example has a tabindex of 0, all other focusable elements have tabindex of -1. I've also removed the tabindex off of the li[role="treeitem"] element; that had matched WAI treeview examples, but our implementation is a bit different and React wasn't updating those tabindices.

The intent is that only a single element inside the treeview will ever have a 0 tabindex, and arrow keys must be used to navigate the treeview (updating the tabindices as you navigate through). The React keyboard navigation logic will need to be updated to work more properly (the PR I have up currently helps improve it).

The issue with having complicated tree views where there may be action items, checkboxes separate from the expansion, or selection separate from the expansion, is that it isn't clear at all that those things exist/are separate especially for screen reader. Similar to our Menu examples where there may be secondary actions, a user may not know they can navigate horizontally in addition to vertically. That, and Left/Right Arrow are expected to have specific functionality depending on the expanded state of the currently focused tree view node, which may be confusing/frustrating if the expectation is that "Right arrow should expand this parent node" but focus is instead moving from the expand toggle to the node text button.

A basic tree view is probably easy enough to traverse and understand, but beyond that some sort of visible text description/instruction may need to be included. For example, something like:

image

(just added a div element inside div.tree-view but before the ul[role="treeview"] element)

What do you both think? Maybe this is something that requires a separate, more in depth discussion, but wanted to propose the above in any case.

Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mcoker mcoker merged commit da1db65 into patternfly:main Apr 23, 2024
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 5.4.0-prerelease.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

dlabaj pushed a commit to dlabaj/patternfly that referenced this pull request Apr 30, 2024
* fix(TreeView): improved a11y experience

* Updated aria-label to match React PR

* Updated tabindices

* Reverted changes affecting tabindices
@dlabaj dlabaj mentioned this pull request Apr 30, 2024
dlabaj pushed a commit to dlabaj/patternfly that referenced this pull request Apr 30, 2024
* fix(TreeView): improved a11y experience

* Updated aria-label to match React PR

* Updated tabindices

* Reverted changes affecting tabindices
@dlabaj dlabaj mentioned this pull request Apr 30, 2024
dlabaj added a commit that referenced this pull request May 1, 2024
* fix(release): updated code to release patch to npmjs

* fix(TreeView): improved a11y experience (#6480)

* fix(TreeView): improved a11y experience

* Updated aria-label to match React PR

* Updated tabindices

* Reverted changes affecting tabindices

* fix(pagination): fixed display for per page menu toggle (#6586)

* fix(pagination): fixed display for per page menu toggle

* chore(pagination): s/pagination-options-menupagination-menu-toggle

* chore(pagination): remove top expanded, add toggle aria-label

* Update pagination-menu-toggle.hbs

remove aria-label

---------

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 5.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - TreeView - Improve a11y experience

4 participants

0