未验证 提交 cf75289b 编写于 作者: J Jonah Williams 提交者: GitHub

TextField is only a live region when it has input focus (#6649)

上级 a6e816b2
......@@ -167,10 +167,10 @@ class AccessibilityBridge
if (object.textSelectionBase != -1 && object.textSelectionExtent != -1) {
result.setTextSelection(object.textSelectionBase, object.textSelectionExtent);
}
// Text fields will always be created as a live region, so that updates to
// the label trigger polite announcements. This makes it easy to follow a11y
// guidelines for text fields on Android.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) {
// Text fields will always be created as a live region when they have input focus,
// so that updates to the label trigger polite announcements. This makes it easy to
// follow a11y guidelines for text fields on Android.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2 && mA11yFocusedObject != null && mA11yFocusedObject.id == virtualViewId) {
result.setLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册