Skip to content

Commit 7efaba6

Browse files
committed
Fix:announcements by the screen reader interrupt any existing speech.
1 parent 966c36a commit 7efaba6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/boot/OfflineNoticeProvider.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ export function OfflineNoticeProvider(props: ProviderProps): Node {
214214
if (shouldShowUncertaintyNotice && !haveAnnouncedUncertain.current) {
215215
// TODO(react-native-68): Use announceForAccessibilityWithOptions to
216216
// queue this behind any in-progress announcements
217-
AccessibilityInfo.announceForAccessibility(_('Zulip’s Internet connection is uncertain.'));
217+
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip’s Internet connection is uncertain.'), { queue: true });
218218
haveAnnouncedUncertain.current = true;
219219
}
220220

221221
if (isOnline === false && (!haveAnnouncedOffline.current || haveAnnouncedUncertain.current)) {
222-
AccessibilityInfo.announceForAccessibility(_('Zulip is offline.'));
222+
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip is offline.'), { queue: false });
223223
haveAnnouncedOffline.current = true;
224224
haveAnnouncedUncertain.current = false;
225225
} else if (
@@ -228,7 +228,8 @@ export function OfflineNoticeProvider(props: ProviderProps): Node {
228228
) {
229229
// TODO(react-native-68): Use announceForAccessibilityWithOptions to
230230
// queue this behind any in-progress announcements
231-
AccessibilityInfo.announceForAccessibility(_('Zulip is online.'));
231+
AccessibilityInfo.announceForAccessibilityWithOptions(_('Zulip is online.'), { queue: true });
232+
232233
haveAnnouncedOffline.current = false;
233234
haveAnnouncedUncertain.current = false;
234235
}

0 commit comments

Comments
 (0)