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

Modal QML Popup not modal to a11y layer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9.2
    • None
    • Android, iOS/tvOS/watchOS, macOS, Windows

      Any QML Popup is not modal to the a11y layer. This means any "underlying" elements are still available to users of screen readers.

      The attached video ModalPopupA11y.movdepicts the issue; after opening the modal Popup the text elements are still in the a11y tree. After opening another modal Popup, the first Popup and the underlying text elements are also visible to the screen reader.

      Consider the following MWE:

      pragma ComponentBehavior: Bound
      
      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
      	id: root
      
      	property list<QtObject> dialogs
      
      	function closeDialog() {
      		let item = dialogs[dialogs.length - 1];
      		item.close();
      		item.destroy();
      		dialogs.length--;
      	}
      	function openDialog() {
      		let item = popupComponent.createObject(root, {
      			index: dialogs.length
      		});
      		dialogs.push(item);
      		item.open();
      	}
      
      	height: 480
      	visible: true
      	width: 640
      
      	ColumnLayout {
      		anchors.centerIn: parent
      
      		Repeater {
      			model: 5
      
      			delegate: Text {
      				required property int index
      
      				Accessible.name: text
      				Accessible.role: Accessible.StaticText
      				Layout.fillWidth: true
      				text: "Text element %1".arg(index)
      			}
      		}
      		Button {
      			text: "Open new dialog"
      
      			onClicked: root.openDialog()
      		}
      	}
      	Component {
      		id: popupComponent
      
      		Popup {
      			required property int index
      
      			anchors.centerIn: parent
      			focus: true
      			modal: true
      
      			contentItem: ColumnLayout {
      				Text {
      					Accessible.name: text
      					Accessible.role: Accessible.StaticText
      					Layout.fillWidth: true
      					text: "Modal dialog %1".arg(index)
      				}
      				Button {
      					text: "Close dialog"
      
      					onClicked: root.closeDialog()
      				}
      				Button {
      					text: "Open new dialog"
      
      					onClicked: root.openDialog()
      				}
      			}
      		}
      	}
      }
      

        For Gerrit Dashboard: QTBUG-140200
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            janmoeller Jan Möller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change