Stop setting the accessibility text if a node has SCOPES_ROUTE set. (flutter/engine#12730)

This keeps us from setting the text on a node if it is a SCOPES_ROUTE node, and sends the "TYPE_VIEW_FOCUSED" event when we update the semantics information and a view has the input focus.
This commit is contained in:
Greg Spencer
2019-10-02 10:35:28 -07:00
committed by GitHub
parent 2a7178e5ce
commit 63258e472e

View File

@@ -737,7 +737,7 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
result.setChecked(semanticsNode.hasFlag(Flag.IS_TOGGLED));
result.setClassName("android.widget.Switch");
result.setContentDescription(semanticsNode.getValueLabelHint());
} else {
} else if (!semanticsNode.hasFlag(Flag.SCOPES_ROUTE)) {
// Setting the text directly instead of the content description
// will replace the "checked" or "not-checked" label.
result.setText(semanticsNode.getValueLabelHint());