Skip to content

Private/rparth07/treeview navigation#15359

Open
rparth07 wants to merge 8 commits intomainfrom
private/rparth07/treeview-navigation
Open

Private/rparth07/treeview navigation#15359
rparth07 wants to merge 8 commits intomainfrom
private/rparth07/treeview-navigation

Conversation

@rparth07
Copy link
Copy Markdown
Contributor

@rparth07 rparth07 commented Apr 2, 2026

Issues resolved:

  1. tabindex attribute is incorrect
  2. Pressing Home, End or any other key do not work. please refer: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/examples/treeview-navigation/#:~:text=View%20Pattern.-,Keyboard%20Support,-Key
  3. Arrow Left: When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node. - this behavior is not working.
  4. Arrow Right: When focus is on a open node, moves focus to the first child node. - this behavior is also not working.
  5. '*' (asterisk): Expands all closed sibling nodes that are at the same level as the focused node. Focus does not move. - this behavior is also not working

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

rparth07 added 8 commits April 3, 2026 10:59
Entries now start with tabindex="-1" instead of "0", so only one entry is in the tab order at a time. restoreInitialTabIndexes preserves tabindex="0" on the selected entry (or the first entry if none is selected) when focus leaves the tree. unselectEntry sets tabIndex to -1 instead of removing the attribute entirely.

The early return in changeFocusedRow that preserved tabindex on selected entries is no longer needed since the focusout handler now restores the correct tab stop.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I7d97dcc7657fcb6586d851c9ecfa52d020ca0a22
introduces behavior for Arrow Left: When focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I96c27c681516fbf8f6a5e7269680889b355235eb
introduces behavior for Arrow Right: When focus is on a open node, moves focus to the first child node.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I558e22b9c556a64f2a531fe3a27be5adbc5cd92e
toggleEntry and expandEntry toggle the collapsed class but did not update aria-expanded to match. Set it to true on expand and false on collapse so screen readers reflect the current state.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I892504b4651fc6e8a7562f3afb93d08fb2e560aa
Move _containerRole assignment after _isNavigator is computed so navigator treeviews get role="tree" instead of role="treegrid", which better matches its single-column, non-editable nature

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I77b96a6b91445039034b07f027ebdd37c76b1496
- Home moves focus and selection to the first visible entry
- End moves focus and selection to the last visible entry

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I271153f03cd38c2c4ec02c3c74ca26c49ceb1e4c
- pressing '*' on a tree entry expands all collapsed siblings at the same level, following the standard tree keyboard pattern.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: If43ef7c0bd3fe89285da7322c61b11d61df836ff
Typing a letter jumps to the next visible entry whose text starts with that character, wrapping around from the end. Modifier keys are ignored so shortcuts are not intercepted.

Signed-off-by: Parth Raiyani <parth.raiyani@collabora.com>
Change-Id: I0be6ccaf8742e47249bc3ce4c10b87c6a0a92959
@caolanm caolanm force-pushed the private/rparth07/treeview-navigation branch from d808cd6 to 657ae7f Compare April 3, 2026 09:59
@caolanm
Copy link
Copy Markdown
Contributor

caolanm commented Apr 3, 2026

is there overlap here with #15352 ?

@hcvcastro
Copy link
Copy Markdown
Member

is there overlap here with #15352 ?

It looks like a duplicated task. I haven't worked on the left and right keys yet. We should resolve this to avoid duplicating effort on the same task.

@rparth07
Copy link
Copy Markdown
Contributor Author

rparth07 commented Apr 6, 2026

is there overlap here with #15352 ?

It looks like a duplicated task. I haven't worked on the left and right keys yet. We should resolve this to avoid duplicating effort on the same task.

Yes, I agree :)

This PR resolves the issues mentioned in PR description.

What do you suggest?

@hcvcastro
Copy link
Copy Markdown
Member

Yes, I agree :)

This PR resolves the issues mentioned in PR description.

What do you suggest?

Please review my changes. I simplified and redesigned the keyboard navigation for the Arrow Up and Arrow Down keys (it's now easier to follow and read). I didn't touch the Left and Right keys for expand/collapse, as I see you already worked on that. If you agree, you can adapt your changes once this is merged.

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

Labels

None yet

Projects

Status: To Review

Development

Successfully merging this pull request may close these issues.

3 participants