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

This commit is contained in:
Michael Goderbauer
2017-12-20 11:15:10 -08:00
committed by GitHub
parent 0ebed16e78
commit 82869d71a5
2 changed files with 6 additions and 2 deletions

View File

@@ -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) {

View File

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