Changed announceForAccessibility implementation to use Assertive live region type instead of Polite. When Polite is used the request for announcement will be overridden by a subsequent narration. Usually this happens when code calls the announcement API and then focus is changed either programmatically or due to UI changes as result of event that was announced - in this case the automatic narration of a newly focused control suppresses the announcement, usually even before it starts. With announcement being Assertive, though, both automatic narration and the announcement are read and no information is lost. (#773)

This commit is contained in:
Yury Zholobov 2018-08-10 18:49:35 -07:00 коммит произвёл Eric Traut
Родитель bec53b6dd4
Коммит 96dccedc22
3 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -139,7 +139,7 @@ abstract class BaseRootView<P extends BaseRootViewProps> extends React.Component
<RN.View
style={ _styles.liveRegionContainer as RN.StyleProp<RN.ViewStyle> }
accessibilityLabel={ this.state.announcementText }
accessibilityLiveRegion={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Polite) }
accessibilityLiveRegion={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Assertive) }
/>
);
}

Просмотреть файл

@ -109,7 +109,7 @@ export class AccessibilityAnnouncer extends React.Component<{}, AccessibilityAnn
return (
<div
style={ _styles.liveRegionContainer as any }
aria-live={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Polite) }
aria-live={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Assertive) }
aria-atomic={ 'true' }
aria-relevant={ 'additions text' }
>

Просмотреть файл

@ -62,7 +62,7 @@ export class AccessibilityAnnouncer extends React.Component<{}, {}> {
<RN.View
ref={ this._onViewRef }
style={ _styles.liveRegionContainer as RN.StyleProp<RN.ViewStyle> }
accessibilityLiveRegion={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Polite) }
accessibilityLiveRegion={ AccessibilityUtil.accessibilityLiveRegionToString(Types.AccessibilityLiveRegion.Assertive) }
/>
);
}