mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Avoid announcing text field when it lacks a11y focus (#6830)
* Avoid announcing text field when it lacks a11y focus
This commit is contained in:
parent
5fb9b18c6e
commit
ea4bbbd440
@ -763,7 +763,12 @@ class AccessibilityBridge
|
||||
sendAccessibilityEvent(event);
|
||||
}
|
||||
if (mInputFocusedObject != null && mInputFocusedObject.id == object.id
|
||||
&& object.hadFlag(Flag.IS_TEXT_FIELD) && object.hasFlag(Flag.IS_TEXT_FIELD)) {
|
||||
&& object.hadFlag(Flag.IS_TEXT_FIELD) && object.hasFlag(Flag.IS_TEXT_FIELD)
|
||||
// If we have a TextField that has InputFocus, we should avoid announcing it if something
|
||||
// else we track has a11y focus. This needs to still work when, e.g., IME has a11y focus
|
||||
// or the "PASTE" popup is used though.
|
||||
// See more discussion at https://github.com/flutter/flutter/issues/23180
|
||||
&& (mA11yFocusedObject == null || (mA11yFocusedObject.id == mInputFocusedObject.id))) {
|
||||
String oldValue = object.previousValue != null ? object.previousValue : "";
|
||||
String newValue = object.value != null ? object.value : "";
|
||||
AccessibilityEvent event = createTextChangedEvent(object.id, oldValue, newValue);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user