Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140748

iOS: Accessibility focus not detectable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.0, 6.9.3, 6.10.0 RC
    • None
    • iOS/tvOS/watchOS

      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);
                              }
                          }
                      }
                  }
              }
          }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            frank.osterfeld Frank Osterfeld
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes