-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.0, 6.9.3, 6.10.0 RC
-
None
On iOS with VoiceOver enabled (also Android/Talkback), the user can iterate over accessibility items using left/right swipe (opposed to select by tap). When having accessibility items in a flickable, the application should ensure that the item gaining accessibility focus is scrolled into the flickable's viewport.
In the following example, I listen to activeFocus changes to ensure the focused item gets centered. This works on Windows and macOS (using keyboard/tab focus) and Android (left/right swipe).
On iOS, left/right swipe changes the item, but I see no notification for this, neither activeFocus nor Accessible.focused get updated. I see no way to get notified of the focus change and scroll the view accordingly.
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Flickable { id: flickable anchors.centerIn: parent width: parent.width height: parent.height / 2 clip: true function centerFlickableItemVertically(item) { const y = item.mapToItem(contentItem, 0, 0).y; const center = y + item.height / 2; contentY = Math.max(0, center - height / 2); } Column { Repeater { model: 20 Button { id: button text: qsTr("Button %1").arg(index) onActiveFocusChanged: { if (activeFocus) { flickable.centerFlickableItemVertically(button); } } } } } } }