Skip to content

Commit

Permalink
a11y: treeview get current entry focused
Browse files Browse the repository at this point in the history
This hack removes the need to press the `tab` key in order to get a tree entry
focused after clicking on it.

That improves usability for the Navigation pane and also for gridview such as
the one for the 'font' tab in the Format cell dialog.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I1be820367f935c8460ab5a60ef74cc648230ac64
  • Loading branch information
mcecchetti authored and eszkadev committed Jan 9, 2025
1 parent 908f621 commit b8aa2a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions browser/src/control/jsdialog/Widget.TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ class TreeViewControl {
L.DomUtil.addClass(span, 'selected');
span.setAttribute('aria-selected', 'true');
span.tabIndex = 0;
span.focus();
if (checkbox) checkbox.removeAttribute('tabindex');
}

Expand Down

0 comments on commit b8aa2a6

Please sign in to comment.