From 87f51e733e98c9dd18f05796406927edd940c728 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Mon, 30 Dec 2024 10:31:14 +0100 Subject: [PATCH] Focus on the alert text when there is an error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to tell screen readers that have to read the text in the notification, or the notification pops up and orca, at least, does not know that it needs to read it. I also had to change the role of SelectableLabel’s TextArea to StaticText or orca would only read the first line. Not sure if that is an error, because TextArea does indeed behave like a StaticText (i.e., a label) in this case, but TextArea has Accessible.multiLine set to true. --- src/ErrorNotification.qml | 2 ++ src/SelectableLabel.qml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/ErrorNotification.qml b/src/ErrorNotification.qml index 3d1dac9..b537d94 100644 --- a/src/ErrorNotification.qml +++ b/src/ErrorNotification.qml @@ -45,6 +45,8 @@ Control { id: label Accessible.ignored: !control.visible + Accessible.role: Accessible.StaticText + focus: control.visible anchors { left: parent.left diff --git a/src/SelectableLabel.qml b/src/SelectableLabel.qml index 616b00d..328f7ed 100644 --- a/src/SelectableLabel.qml +++ b/src/SelectableLabel.qml @@ -10,6 +10,9 @@ Control { contentItem: TextArea { id: textArea + Accessible.ignored: control.Accessible.ignored + Accessible.role: control.Accessible.role + focus: control.focus padding: 0 readOnly: true selectByMouse: true