Skip to content

Commit 045ee10

Browse files
authored
Fix an issue where a focused node is not announced (#126)
1 parent 85d450e commit 045ee10

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

flutter/shell/platform/common/accessibility_bridge.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "accessibility_bridge.h"
66

7+
#include <cstring>
78
#include <functional>
89
#include <utility>
910

@@ -607,6 +608,16 @@ AccessibilityBridge::FromFlutterSemanticsNode(
607608
}
608609
if (flutter_node.tooltip) {
609610
result.tooltip = std::string(flutter_node.tooltip);
611+
// Tooltips are not announced when a node is focused, resulting in no
612+
// message. In current Tizen, if a node doesn't have a label, hint, and
613+
// value, then the screen reader announces the node's type (ex. 'Button').
614+
// To be consistent with Android and prevent the screen reader from
615+
// announcing the node as unlabeled, tooltips should be used as the message.
616+
if ((!flutter_node.label || strlen(flutter_node.label) == 0) &&
617+
(!flutter_node.hint || strlen(flutter_node.hint) == 0) &&
618+
(!flutter_node.value || strlen(flutter_node.value) == 0)) {
619+
result.value = std::string(flutter_node.tooltip);
620+
}
610621
}
611622
result.text_direction = flutter_node.text_direction;
612623
result.rect = flutter_node.rect;

0 commit comments

Comments
 (0)