Skip to content

keep focused element and selected in sync#15123

Open
caolanm wants to merge 4 commits intomainfrom
private/caolan/treeview_focus_and_selection
Open

keep focused element and selected in sync#15123
caolanm wants to merge 4 commits intomainfrom
private/caolan/treeview_focus_and_selection

Conversation

@caolanm
Copy link
Contributor

@caolanm caolanm commented Mar 20, 2026

Change-Id: I28ad5af87f9f6bbf7f738f1a4bda7310cd445134

  • Resolves: #
  • Target version: main

Summary

TODO

  • ...

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

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I28ad5af87f9f6bbf7f738f1a4bda7310cd445134
caolanm added 2 commits March 20, 2026 15:37
Treeview rows had no id attribute. When pressing Enter on a treeview
entry, core triggers _updateWidgetImpl.

That method saves document.activeElement.id, rebuilds the widget, then
tries to restore focus by finding an element with that the old id. Since
the button had no id the fallback of sending focus to the document body
happens.

Use the same fix and pattern as:

  commit 3f985cb
  Date:   Tue Jun 17 13:23:38 2025 +0530

      iconview: added support for keyboard navigation after click

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie37a93dc52d41668169a8c03bcae23c82ad9c710
it goes from the dialog to the document. This can be seen in
the chapter/heading dialog in writer. Open the dialog, press twice
to ensure the focus can be seen in the treeview, press return,
the focus disappears and up/down no longer had an effect.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Iede45ff2bdd3ebdd46776ba48ee3ca009e3023a0
@caolanm caolanm force-pushed the private/caolan/treeview_focus_and_selection branch from f0a183b to eba80da Compare March 20, 2026 15:40
I don't care if the dialog closes or stays open, but if it stays
open then the focus should stay in the dialog.

Pressing enter poses a problem with chrome during cypress tests
with CDP where the form submission default isn't blocked as it
is normally. So added a bodge around for that so the issue can
be property tested.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5e241ea91f7467643b4a9c63eb1ea045df8527fa
@caolanm caolanm force-pushed the private/caolan/treeview_focus_and_selection branch from 295d660 to 638954a Compare March 20, 2026 15:54
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.

1 participant