未验证 提交 937bde8f 编写于 作者: M Michael Goderbauer 提交者: GitHub

A11y nodes with only value or hint are focusable (#4481)

上级 718bda0c
......@@ -663,7 +663,11 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess
boolean isFocusable() {
int scrollableActions = Action.SCROLL_RIGHT.value | Action.SCROLL_LEFT.value
| Action.SCROLL_UP.value | Action.SCROLL_DOWN.value;
return flags != 0 || (label != null && !label.isEmpty()) || (actions & ~scrollableActions) != 0;
return (actions & ~scrollableActions) != 0
|| flags != 0
|| (label != null && !label.isEmpty())
|| (value != null && !value.isEmpty())
|| (hint != null && !hint.isEmpty());
}
void updateRecursively(float[] ancestorTransform, Set<SemanticsObject> visitedObjects, boolean forceUpdate) {
......
......@@ -159,7 +159,7 @@ bool GeometryComparator(SemanticsObject* a, SemanticsObject* b) {
// Note: hit detection will only apply to elements that report
// -isAccessibilityElement of YES. The framework will continue scanning the
// entire element tree looking for such a hit.
return _node.flags != 0 || !_node.label.empty() ||
return _node.flags != 0 || !_node.label.empty() || !_node.value.empty() || !_node.hint.empty() ||
(_node.actions & ~blink::kScrollableSemanticsActions) != 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册