slint icon indicating copy to clipboard operation
slint copied to clipboard

Accessible focus not updated inside list views

Open DataTriny opened this issue 1 year ago • 1 comments

When using the arrow keys or when clicking on items inside a list view, the focused item displays a visual indication of its state change but the accessibility tree does not get updated to reflect this.

Currently, list view items are not keyboard focusable as far as AccessKit is concerned. This can easily be fixed:

diff --git a/internal/backends/winit/accesskit.rs b/internal/backends/winit/accesskit.rs
index 9d078e8f9..6e6e7bdc8 100644
--- a/internal/backends/winit/accesskit.rs
+++ b/internal/backends/winit/accesskit.rs
@@ -414,6 +414,7 @@ fn build_node_without_children(&self, item: &ItemRc, scale_factor: ScaleFactor)
             Role::Button
                 | Role::CheckBox
                 | Role::ComboBox
+                | Role::ListBoxOption
                 | Role::Slider
                 | Role::SpinButton
                 | Role::Tab

I am able to say that no AccessKit tree is pushed to move the focus to the currently focused item. It is unclear to me whether the manually set has-focus property of the ListItem triggers any built-in mechanism in the runtime.

I intended to use Slint as my testbed for actually implementing list view support inside AccessKit so I am willing to help fix this if it's not too involved. Help or guidance appreciated!

DataTriny avatar Oct 14 '24 21:10 DataTriny

I think the StandardListView widget is missing an accessible-delegate-focus property somewhere. But I was able to verify that no AccessKit tree is pushed when the current tab of a TabList widget changes, so I think a more fundamental piece is missing.

If I add accessible-delegate-focus: root.focus-item; to the StandardListView, arrowing through the items still doesn't push a new tree and when tabbing out and back into the list view appears to focus the list itself.

DataTriny avatar Oct 16 '24 21:10 DataTriny