Skip to content
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

Unexpected keyboard navigation experience with nested trees #6861

Closed
SaraLawrence opened this issue Apr 25, 2023 · 8 comments
Closed

Unexpected keyboard navigation experience with nested trees #6861

SaraLawrence opened this issue Apr 25, 2023 · 8 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-tree Issues that pertain to the calcite-tree and related components estimate - 3 A day or two of work, likely requires updates to tests. p - medium Issue is non core or affecting less that 60% of people using the library refactor Issues tied to code that needs to be significantly reworked.

Comments

@SaraLawrence
Copy link

SaraLawrence commented Apr 25, 2023

Summary

Questioning the use of nested trees and the effect on keyboard only users. Also, wondering why slots are implemented at the tree-item level rather than at the tree level?

Actual Behavior

Keyboard only users expect to be able to navigate between nodes with the up and down arrow keys and also move into a group of children using the down arrow. It is confusing to have to first press right or left arrow in order to move up or down.

Also, screen reader support for trees is not consistent and implementing them as a series of trees when visually they appear to be one component, can be confusing for blind screen reader users.

Example: JAWS only recognizes two of the four patterns in the sample codepen:

Tree views in JAWS list view

Expected Behavior

  • Expected behavior for tab is to move into the tree and out of the tree. With Calcite, tab moves to what visually appears to be the next "depth 1" item. This is confusing for screen reader users because they can't see the relationship that appears visually between "Grandfather" and "Great uncle".
  • Ideally, if it's one cohesive unit visually and there are expected keyboard commands associated with the role, it should be presented to screen readers as one cohesive unit, i.e, one role="tree", and the commands should follow the pattern, with down-arrow and up-arrow always available.

All of the W3C and Deque examples use role="group" to contain child items, rather than nesting trees and the keyboard behavior is more straightforward.

Reproduction Sample

https://codepen.io/paulcp/pen/GRYjaoY

Reproduction Steps

  1. Tab onto first tree-item "Grandfather"
  2. Use right-arrow to expand
    • I would expect to use the down arrow to move down to Father at this point but right-arrow is required (In all the examples on W3C and Deque U, you can use either the right-arrow or the down-arrow at this point.)
  3. Once focus is on "Father", expand
    • Once expanded, I would expect to use down-arrow to move to "Sister", but right-arrow is required.
    • Down-arrow is only available to move to items with no children and this does not follow the expected keyboard pattern for tree.
  4. Set focus on "Sister"
    • As a screen reader user I would assume I need to use right-arrow again since that's the only key that enabled me to continue moving down the tree but now only down-arrow is available for that action.

Reproduction Version

1.2.0

Working W3C Example/Tutorial

See Expected Behavior

Relevant Info

Windows 10, Chrome, JAWS, NVDA

Regression?

No response

Priority impact

p3 - want for upcoming milestone

Esri team

ArcGIS Online

@SaraLawrence SaraLawrence added 0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Apr 25, 2023
@github-actions github-actions bot added p3 - want for upcoming milestone ArcGIS Online Issues logged by ArcGIS Online team members. labels Apr 25, 2023
@geospatialem geospatialem added the need more info Issues that are missing information and/or a clear, actionable description. label Apr 25, 2023
@geospatialem
Copy link
Member

Per our Teams discussion, adding the needs more info label for additional repro steps to be added shortly.

@SaraLawrence
Copy link
Author

@geospatialem Added more to reproduction steps

@geospatialem geospatialem added research Issues that require more in-depth research or multiple team members to resolve or make decision. and removed need more info Issues that are missing information and/or a clear, actionable description. labels May 2, 2023
@geospatialem
Copy link
Member

Thanks @SaraLawrence! Reorganized content a bit in the above description. Updates will be posted on next steps once triaged.

@geospatialem geospatialem added the refactor Issues tied to code that needs to be significantly reworked. label May 2, 2023
@geospatialem
Copy link
Member

Research will be conducted in an upcoming milestone prior to assigning to developers.

@geospatialem geospatialem self-assigned this May 2, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. p - medium Issue is non core or affecting less that 60% of people using the library and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. p - high Issue should be addressed in the current milestone, impacts component or core functionality labels May 2, 2023
@geospatialem geospatialem added this to the 2023 July Priorities milestone May 2, 2023
@geospatialem geospatialem added the c-tree Issues that pertain to the calcite-tree and related components label May 4, 2023
@geospatialem
Copy link
Member

geospatialem commented Jul 31, 2023

Anticipated keyboard behavior (with and without AT active):

Tab method refactor (getRootTabIndex private method?):

  • The first tree-item should be focusable with the tab key
  • If tab is pressed while in the component, focus leaves the component

keyDownHandler keyboard event refactor:

  • If a tree-item is expanded, the down arrow key should move to the next child element (and up arrow to the previous)
  • Once within an expanded tree-item, all subsequent children should be accessed via the down arrow and up arrow keys
  • Once the expanded children tree-items are accessed the up arrow and down arrow keys should be able to access other tree-items, included other expanded items.
  • The Home key should bring the user to the first expanded tree-item
  • The End key should bring the user to the last expanded tree-item

W3C example gif:

expected-keyboard-navigation-tree

@geospatialem geospatialem added estimate - 3 A day or two of work, likely requires updates to tests. 0 - new New issues that need assignment. and removed research Issues that require more in-depth research or multiple team members to resolve or make decision. 1 - assigned Issues that are assigned to a sprint and a team member. labels Jul 31, 2023
@geospatialem geospatialem removed their assignment Jul 31, 2023
@geospatialem geospatialem removed this from the 2023 July Priorities milestone Aug 1, 2023
@geospatialem geospatialem added this to the 2023 August Priorities milestone Aug 1, 2023
@geospatialem
Copy link
Member

geospatialem commented Aug 1, 2023

Reallocating the target to the August milestone for the development effort.

@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Aug 23, 2023
@jcfranco jcfranco self-assigned this Aug 23, 2023
jcfranco added a commit that referenced this issue Aug 29, 2023
**Related Issue:** #6861 

## Summary

Improves tree's keyboard navigation to move across all items and users
can now tab to the next focusable element without having to traverse all
items.

### Notes

* items are now programmatically-focusable only (e.g., `tabindex="-1"`)
since the tree moves focus
* keyboard navigation based on
https://www.w3.org/WAI/ARIA/apg/patterns/treeview/examples/treeview-1a/#kbd_label
* consolidated tree tests and improved coverage
* moved all navigation logic to the tree-level
* refactored item traversal logic to cover all cases
* moved tree `keyDownHandler` to use VDOM event.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Aug 29, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@github-actions github-actions bot assigned geospatialem and unassigned jcfranco Aug 29, 2023
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Aug 30, 2023
@geospatialem
Copy link
Member

Verified in 1.7.0-next.13 with the criteria above ☝🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. a11y Issues related to Accessibility fixes or improvements. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-tree Issues that pertain to the calcite-tree and related components estimate - 3 A day or two of work, likely requires updates to tests. p - medium Issue is non core or affecting less that 60% of people using the library refactor Issues tied to code that needs to be significantly reworked.
Projects
None yet
Development

No branches or pull requests

3 participants