You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Account - The date picker modal is not announced as "calendar opened" #91502
Version Number: 9.3.80-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#90448 Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 15.4.1 Safari/Chrome App Component: User Settings
The DatePicker component already has an accessibility announcement mechanism via useAccessibilityAnnouncement. When the calendar opens, it creates an aria-live="assertive" wrapper div and injects a role="alert" text node with the "calendar opened" message (index.ts:76-87).
The problem is that on the first calendar open in a session, the aria-live wrapper div is created and populated in the same synchronous DOM operation (index.ts:39-58 called from index.ts:77). VoiceOver on Mac (Safari and Chrome) does not reliably announce content that is added to a newly createdaria-live region in the same DOM mutation — the accessibility tree needs at least one rendering frame to "register" the live region before content changes are announced.
Additionally, the announcement root is determined by getAnnouncementRoot(), which checks document.activeElement. Since the text input is blurred before the modal opens, focus falls to document.body, and the function falls back to picking the last [role="dialog"][aria-modal="true"] in DOM order. When the calendar popover's dialog (via react-native-web's ModalContent) hasn't fully registered in the accessibility tree yet, this can cause the announcement to be scoped to the wrong modal context.
What changes do you think we should make in order to solve the problem?
In useAccessibilityAnnouncement/index.ts, split the wrapper creation and content insertion into two separate frames when the wrapper is newly created. Inside the setTimeout callback at line 76, after getWrapper() returns a newly created wrapper, use requestAnimationFrame to defer the content insertion by one frame, giving VoiceOver time to register the live region before content is added. When the wrapper already exists (reuse path), the current synchronous insertion is fine.
What alternative solutions did you explore? (Optional)
Pre-creating the aria-live wrapper at app startup: This would ensure the region is always registered, but it couples a UI concern to the app lifecycle and may conflict with the dynamic dialog-scoping logic that moves the wrapper between modal contexts.
Using AccessibilityInfo.announceForAccessibility on web: React Native Web doesn't support this API on web, which is why the custom DOM-based approach exists.
Investigation details
Announcement flow on web:
User clicks date input → showDatePickerModal() blurs the input and sets isModalVisible=true
At 300ms, getWrapper() creates (or reuses) an aria-live="assertive" div inside the topmost dialog
A role="alert" div with the message text is appended to the wrapper
Why first-open fails: The module-level wrapper variable (line 25) starts as null. On first open, getWrapper() creates the div and the text is added immediately — same synchronous call stack. VoiceOver doesn't announce because the live region wasn't present in the previous accessibility tree snapshot.
Modal scoping: The calendar popover renders as a fullscreen RN Modal (coverScreen=true via BaseModal.tsx:367), which react-native-web portals to document.body with aria-modal="true" and role="dialog" (when active). The RHP settings panel is also a dialog. The getAnnouncementRoot() function handles this by selecting the last dialog in DOM order.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
🚨 Edited by proposal-police: This proposal was edited at 2026-05-23 09:27:42 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
With VoiceOver on, navigating to Account > Profile > Date of birth never announces "calendar opened" — because the date picker modal never opens in the first place.
What is the root cause of that problem?
The DOB page renders <DatePicker ... autoFocus />. With autoFocus, DatePicker relies on the text input's onFocus to call showDatePickerModal (see line 157 of DatePicker/index.tsx). But useAutoFocusInput short-circuits when a screen reader is active to avoid hijacking screen-reader navigation:
So with VoiceOver on, the input is never programmatically focused, onFocus → showDatePickerModal never fires, isModalVisible stays false, and the useAccessibilityAnnouncement introduced in PR #90448 never triggers. The PR's QA path tested with VoiceOver off, where auto-focus does open the modal, which is why it passed review but regresses for screen-reader users.
What changes do you think we should make in order to solve the problem?
In src/components/DatePicker/index.tsx, when autoFocus is true and useAutoFocusInput is going to skip focusing the input (i.e. Accessibility.useScreenReaderStatus() returns true), open the modal directly via showDatePickerModal() once the screen finishes transitioning. We can do this with a useFocusEffect that, gated on autoFocus && isScreenReaderEnabled && !isModalVisible, calls showDatePickerModal() after InteractionManager.runAfterInteractions so popover positioning has settled. This restores the auto-open behavior on single-input DatePicker screens (DOB, IOURequestStepDate, EditReportFieldDate) for screen-reader users, which in turn lets the existing announcement fire as designed.
PR #90448 wired up useAccessibilityAnnouncement(announcementMessage, isModalVisible, { shouldAnnounceOnNative: true, shouldAnnounceOnWeb: true }) so that "Calendar opened" is dispatched the moment isModalVisible flips to true:
But the announcement is sent before the calendar UI lands in the accessibility tree, and on top of a focus event that is in the middle of tearing down. Specifically, showDatePickerModal blurs the input and then flips the state in the same tick:
After textInputRef.current?.blur(), native focus (and document.activeElement on web) falls back to body / no focused element. React then commits isModalVisible = true, the iOS hook fires AccessibilityInfo.announceForAccessibility(...) 100 ms later, and the web hook fires its aria-live insertion 300 ms later. But DatePickerModal doesn't mount CalendarPicker synchronously — PopoverWithMeasuredContent defers content render until anchor measurement completes, and never marks the popover container with accessibilityViewIsModal / role="dialog"+aria-modal="true":
The net effect on VoiceOver (iOS App + macOS Safari/Chrome — both the affected platforms):
iOS:announceForAccessibility is fire-and-forget and is scoped to the currently focused AX context. At the 100 ms mark there is no focused context inside the new popover (it isn't accessibility-modal, focus is on the just-blurred input/body), so the utterance is routed to a tearing-down ancestor and silently dropped.
macOS VoiceOver (web): the web hook's getAnnouncementRoot() searches for the topmost [role="dialog"][aria-modal="true"] and appends an aria-live region inside it (https://github.com/Expensify/App/blob/main/src/hooks/useAccessibilityAnnouncement/index.ts#L27-L37). Because the calendar popover never sets those attributes (shouldDisplayBelowModals is the only modal-related prop), the alert gets appended to the RHP wrapper above it rather than to the calendar's own context, and VoiceOver — which is scoped to whatever it most recently saw activate — doesn't speak it.
TalkBack and NVDA/Narrator don't have this strict focused-context routing, which lines up with the bug only reproducing on the two VoiceOver-based platforms.
What changes do you think we should make in order to solve the problem?
Instead of layering more delay onto a fire-and-forget announcement, give VoiceOver a proper modal AX scope to attach to and let it announce the calendar via the focus path it already follows for modals. Two small changes:
1. Mark the popover content as an accessibility-modal scope with a name in src/components/DatePicker/DatePickerModal.tsx. RN maps accessibilityViewIsModal to iOS' modal trap and accessibilityRole="dialog" to web's role="dialog" + aria-modal="true" — which is exactly the selector the existing web hook is looking for, and exactly the trait iOS VoiceOver needs to know "I'm in a new modal context":
2. Move VoiceOver focus into the calendar once it lays out, so the new modal context actually receives focus and is announced. Inside CalendarPicker (the root View), attach an onLayout that runs once, grabs the node handle, and calls AccessibilityInfo.setAccessibilityFocus(reactTag). On iOS this triggers VoiceOver to read the wrapper's accessibilityLabel ("Calendar opened") followed by the focused day. On web, focusing the dialog node (element.focus()) makes macOS VoiceOver enter the dialog and announce its accessible name. This is the canonical iOS HIG pattern for modal presentations and avoids racing against announceForAccessibility entirely.
- AccessibilityInfo.announceForAccessibility(message);+ const tag = findNodeHandle(calendarRef.current);+ if (tag != null) {+ AccessibilityInfo.setAccessibilityFocus(tag);+ }
(That snippet is illustrative — the actual call lives in a one-shot onLayout inside CalendarPicker, not in the announcement hook.)
3. Remove the redundant upstream call atDatePicker/index.tsx#L45-L46(or guard it with !isScreenReaderEnabled) once focus-driven announcement is in place, so VoiceOver doesn't get a duplicate "Calendar opened" between the focus event and the manual announceForAccessibility.
Test updates: in tests/unit/components/DatePickerTest.tsx, render the picker, flip isModalVisible, and (a) assert the wrapper around CalendarPicker has accessibilityViewIsModal={true} and accessibilityRole="dialog", (b) mock AccessibilityInfo.setAccessibilityFocus and assert it is called once with the calendar's node handle after first layout.
Switching the iOS path to AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true }). This addresses one symptom — utterances being preempted during focus shifts — but does not give VoiceOver anywhere to land afterward: the user hears "Calendar opened" and is then stranded with focus on the blurred input or body, with no path into the calendar grid. The focus-driven approach fixes "what is announced" and "where the user ends up", which matters more for a date picker than for, e.g., a toast.
Setting accessibilityHint="Opens calendar" and accessibilityState={{ expanded: isModalVisible }} on the input (https://github.com/Expensify/App/blob/main/src/components/DatePicker/index.tsx#L140-L161). Rejected — accessibilityHint is read on focus, before the modal opens, and the expanded state produces "expanded"/"collapsed" instead of the "Calendar opened" copy in the bug report. Useful as a small additive cue but doesn't satisfy the expected behavior.
Please re-state the problem that we are trying to solve in this issue.
With VoiceOver enabled, opening the date picker on Account > Profile > Date of birth does not announce "calendar opened". The announcement is missing on macOS (Chrome/Safari) and on the iOS app. Note that Android and Windows are not affected — only the two platforms that use VoiceOver.
What is the root cause of that problem?
The "calendar opened" announcement is wired up correctly in the DatePicker. When the modal becomes visible it calls the accessibility-announcement hook:
The problem is in the hook implementations, and it is specific to VoiceOver. That is why only macOS (Chrome/Safari) and iOS are reported, while Android (TalkBack) and Windows (NVDA/Narrator) work — those screen readers don't share VoiceOver's restriction.
Web (macOS VoiceOver). The web hook places the announcement inside a freshly-created aria-live wrapper, and it both creates the wrapper and fills it with the message in the same setTimeout callback:
getWrapper() was deliberately moved inside this timeout so the modal's aria-modal="true" DOM is mounted before the wrapper is positioned (this fixed Android web in a prior PR). But VoiceOver on macOS only announces a live region whose content changes after the region already existed in the accessibility tree. A live region that is inserted into the DOM and populated in the same tick is silently ignored — so VoiceOver never speaks the message. TalkBack/NVDA do not have this restriction, which matches the affected-platform list exactly.
iOS (VoiceOver). The iOS hook announces with the non-queued API:
When the date picker popover mounts, VoiceOver shifts focus into the new modal and speaks the focused element. Because announceForAccessibility is fire-and-forget with no queueing, that focus-driven utterance preempts and drops the "calendar opened" announcement.
What changes do you think we should make in order to solve the problem?
Fix each VoiceOver path while preserving the existing Android/Windows behavior:
Web hook (src/hooks/useAccessibilityAnnouncement/index.ts): split the single-tick logic into two phases so the live region exists before its content changes. Inside the setTimeout, first obtain/append the empty aria-live wrapper (keeping it inside the timeout so the modal DOM is already mounted, which preserves the Android fix), then defer writing the message into that wrapper by one more frame using requestAnimationFrame (or a short nested timeout). This guarantees VoiceOver has registered the live region before the text mutation arrives, so the change is announced. Android/Windows are unaffected because their screen readers announce the mutation regardless of ordering.
iOS hook (src/hooks/useAccessibilityAnnouncement/index.ios.ts): replace the non-queued AccessibilityInfo.announceForAccessibility(message) call with AccessibilityInfo.announceForAccessibilityWithOptions(message, {queue: true}). Queueing makes the announcement play after VoiceOver finishes the modal's focus announcement instead of being discarded by it. The existing 100ms tree-sync delay can stay.
No change is needed in DatePicker/index.tsx — the announcement string and trigger are already correct; only the delivery in the two VoiceOver hooks needs fixing.
What alternative solutions did you explore? (Optional)
For iOS, simply increasing DELAY_FOR_ACCESSIBILITY_TREE_SYNC so the announcement fires after the focus shift was considered, but that is timing-fragile across devices and animation speeds; {queue: true} is the deterministic fix.
For web, mounting a single persistent aria-live region once (e.g. at app root) instead of creating it on demand would also work, but it is a broader change to the shared hook and risks affecting other consumers; the two-phase create-then-populate approach is the minimal, localized fix.
changed the title [-]Account - The date picker modal is not announced as "calendar opened"[/-][+][$250] Account - The date picker modal is not announced as "calendar opened"[/+]on May 23, 2026
Activity
applause-bot commentedon May 23, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/e76d89182b5a4f298a196cfbaeb17c47eeb9d2836e2b02a957edeff40c7b64c4
MelvinBot commentedon May 23, 2026
Proposal
What is the root cause of that problem?
The DatePicker component already has an accessibility announcement mechanism via
useAccessibilityAnnouncement. When the calendar opens, it creates anaria-live="assertive"wrapper div and injects arole="alert"text node with the "calendar opened" message (index.ts:76-87).The problem is that on the first calendar open in a session, the
aria-livewrapper div is created and populated in the same synchronous DOM operation (index.ts:39-58called fromindex.ts:77). VoiceOver on Mac (Safari and Chrome) does not reliably announce content that is added to a newly createdaria-liveregion in the same DOM mutation — the accessibility tree needs at least one rendering frame to "register" the live region before content changes are announced.Additionally, the announcement root is determined by
getAnnouncementRoot(), which checksdocument.activeElement. Since the text input is blurred before the modal opens, focus falls todocument.body, and the function falls back to picking the last[role="dialog"][aria-modal="true"]in DOM order. When the calendar popover's dialog (via react-native-web'sModalContent) hasn't fully registered in the accessibility tree yet, this can cause the announcement to be scoped to the wrong modal context.What changes do you think we should make in order to solve the problem?
In
useAccessibilityAnnouncement/index.ts, split the wrapper creation and content insertion into two separate frames when the wrapper is newly created. Inside thesetTimeoutcallback at line 76, aftergetWrapper()returns a newly created wrapper, userequestAnimationFrameto defer the content insertion by one frame, giving VoiceOver time to register the live region before content is added. When the wrapper already exists (reuse path), the current synchronous insertion is fine.What alternative solutions did you explore? (Optional)
aria-livewrapper at app startup: This would ensure the region is always registered, but it couples a UI concern to the app lifecycle and may conflict with the dynamic dialog-scoping logic that moves the wrapper between modal contexts.AccessibilityInfo.announceForAccessibilityon web: React Native Web doesn't support this API on web, which is why the custom DOM-based approach exists.Investigation details
Announcement flow on web:
showDatePickerModal()blurs the input and setsisModalVisible=trueuseAccessibilityAnnouncementdetects the state change and starts a 300ms timergetWrapper()creates (or reuses) anaria-live="assertive"div inside the topmost dialogrole="alert"div with the message text is appended to the wrapperWhy first-open fails: The module-level
wrappervariable (line 25) starts asnull. On first open,getWrapper()creates the div and the text is added immediately — same synchronous call stack. VoiceOver doesn't announce because the live region wasn't present in the previous accessibility tree snapshot.Modal scoping: The calendar popover renders as a fullscreen RN Modal (
coverScreen=trueviaBaseModal.tsx:367), which react-native-web portals todocument.bodywitharia-modal="true"androle="dialog"(when active). The RHP settings panel is also a dialog. ThegetAnnouncementRoot()function handles this by selecting the last dialog in DOM order.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.MobileMage commentedon May 23, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-23 09:27:42 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
With VoiceOver on, navigating to Account > Profile > Date of birth never announces "calendar opened" — because the date picker modal never opens in the first place.
What is the root cause of that problem?
The DOB page renders
<DatePicker ... autoFocus />. WithautoFocus,DatePickerrelies on the text input'sonFocusto callshowDatePickerModal(see line 157 ofDatePicker/index.tsx). ButuseAutoFocusInputshort-circuits when a screen reader is active to avoid hijacking screen-reader navigation:App/src/hooks/useAutoFocusInput.ts
Lines 57 to 68 in 2fac812
So with VoiceOver on, the input is never programmatically focused,
onFocus→showDatePickerModalnever fires,isModalVisiblestaysfalse, and theuseAccessibilityAnnouncementintroduced in PR #90448 never triggers. The PR's QA path tested with VoiceOver off, where auto-focus does open the modal, which is why it passed review but regresses for screen-reader users.What changes do you think we should make in order to solve the problem?
In
src/components/DatePicker/index.tsx, whenautoFocusis true anduseAutoFocusInputis going to skip focusing the input (i.e.Accessibility.useScreenReaderStatus()returnstrue), open the modal directly viashowDatePickerModal()once the screen finishes transitioning. We can do this with auseFocusEffectthat, gated onautoFocus && isScreenReaderEnabled && !isModalVisible, callsshowDatePickerModal()afterInteractionManager.runAfterInteractionsso popover positioning has settled. This restores the auto-open behavior on single-input DatePicker screens (DOB, IOURequestStepDate, EditReportFieldDate) for screen-reader users, which in turn lets the existing announcement fire as designed.The relevant call site to fix is here:
App/src/components/DatePicker/index.tsx
Lines 83 to 89 in 2fac812
What alternative solutions did you explore? (Optional)
N/A
David-2002065 commentedon May 23, 2026
Proposal
What is the root cause of that problem?
PR #90448 wired up
useAccessibilityAnnouncement(announcementMessage, isModalVisible, { shouldAnnounceOnNative: true, shouldAnnounceOnWeb: true })so that "Calendar opened" is dispatched the momentisModalVisibleflips totrue:https://github.com/Expensify/App/blob/main/src/components/DatePicker/index.tsx#L44-L46
But the announcement is sent before the calendar UI lands in the accessibility tree, and on top of a focus event that is in the middle of tearing down. Specifically,
showDatePickerModalblurs the input and then flips the state in the same tick:https://github.com/Expensify/App/blob/main/src/components/DatePicker/index.tsx#L83-L89
After
textInputRef.current?.blur(), native focus (anddocument.activeElementon web) falls back to body / no focused element. React then commitsisModalVisible = true, the iOS hook firesAccessibilityInfo.announceForAccessibility(...)100 ms later, and the web hook fires itsaria-liveinsertion 300 ms later. ButDatePickerModaldoesn't mountCalendarPickersynchronously —PopoverWithMeasuredContentdefers content render until anchor measurement completes, and never marks the popover container withaccessibilityViewIsModal/role="dialog"+aria-modal="true":https://github.com/Expensify/App/blob/main/src/components/DatePicker/DatePickerModal.tsx#L67-L91
The net effect on VoiceOver (iOS App + macOS Safari/Chrome — both the affected platforms):
announceForAccessibilityis fire-and-forget and is scoped to the currently focused AX context. At the 100 ms mark there is no focused context inside the new popover (it isn't accessibility-modal, focus is on the just-blurred input/body), so the utterance is routed to a tearing-down ancestor and silently dropped.getAnnouncementRoot()searches for the topmost[role="dialog"][aria-modal="true"]and appends anaria-liveregion inside it (https://github.com/Expensify/App/blob/main/src/hooks/useAccessibilityAnnouncement/index.ts#L27-L37). Because the calendar popover never sets those attributes (shouldDisplayBelowModalsis the only modal-related prop), the alert gets appended to the RHP wrapper above it rather than to the calendar's own context, and VoiceOver — which is scoped to whatever it most recently saw activate — doesn't speak it.TalkBack and NVDA/Narrator don't have this strict focused-context routing, which lines up with the bug only reproducing on the two VoiceOver-based platforms.
What changes do you think we should make in order to solve the problem?
Instead of layering more delay onto a fire-and-forget announcement, give VoiceOver a proper modal AX scope to attach to and let it announce the calendar via the focus path it already follows for modals. Two small changes:
1. Mark the popover content as an accessibility-modal scope with a name in
src/components/DatePicker/DatePickerModal.tsx. RN mapsaccessibilityViewIsModalto iOS' modal trap andaccessibilityRole="dialog"to web'srole="dialog"+aria-modal="true"— which is exactly the selector the existing web hook is looking for, and exactly the trait iOS VoiceOver needs to know "I'm in a new modal context":shouldSkipRemeasurement forwardedFSClass={forwardedFSClass} shouldDisplayBelowModals > + <View + accessibilityViewIsModal + accessibilityRole="dialog" + accessibilityLabel={translate('common.calendarOpened')} + > <CalendarPicker minDate={minDate} maxDate={maxDate} value={selectedDate} onSelected={handleDateSelection} shouldEnableMonthYearBackdropInNarrowPane={shouldEnableMonthYearBackdropInNarrowPane} /> + </View> </PopoverWithMeasuredContent>2. Move VoiceOver focus into the calendar once it lays out, so the new modal context actually receives focus and is announced. Inside
CalendarPicker(the rootView), attach anonLayoutthat runs once, grabs the node handle, and callsAccessibilityInfo.setAccessibilityFocus(reactTag). On iOS this triggers VoiceOver to read the wrapper'saccessibilityLabel("Calendar opened") followed by the focused day. On web, focusing the dialog node (element.focus()) makes macOS VoiceOver enter the dialog and announce its accessible name. This is the canonical iOS HIG pattern for modal presentations and avoids racing againstannounceForAccessibilityentirely.(That snippet is illustrative — the actual call lives in a one-shot
onLayoutinsideCalendarPicker, not in the announcement hook.)3. Remove the redundant upstream call at
DatePicker/index.tsx#L45-L46(or guard it with!isScreenReaderEnabled) once focus-driven announcement is in place, so VoiceOver doesn't get a duplicate "Calendar opened" between the focus event and the manualannounceForAccessibility.Test updates: in
tests/unit/components/DatePickerTest.tsx, render the picker, flipisModalVisible, and (a) assert the wrapper aroundCalendarPickerhasaccessibilityViewIsModal={true}andaccessibilityRole="dialog", (b) mockAccessibilityInfo.setAccessibilityFocusand assert it is called once with the calendar's node handle after first layout.What alternative solutions did you explore?
Bumping
DELAY_FOR_ACCESSIBILITY_TREE_SYNCfrom 100 ms to ~400 ms in the iOS hook (https://github.com/Expensify/App/blob/main/src/hooks/useAccessibilityAnnouncement/index.ios.ts#L27-L30). Rejected — popover measurement time varies with device and layout work, so a fixed delay either fires too early on slow devices or wastes a perceptible chunk of time on fast ones, and it doesn't fix the missing modal AX scope on web. Focus management is deterministic.Switching the iOS path to
AccessibilityInfo.announceForAccessibilityWithOptions(message, { queue: true }). This addresses one symptom — utterances being preempted during focus shifts — but does not give VoiceOver anywhere to land afterward: the user hears "Calendar opened" and is then stranded with focus on the blurred input or body, with no path into the calendar grid. The focus-driven approach fixes "what is announced" and "where the user ends up", which matters more for a date picker than for, e.g., a toast.Setting
accessibilityHint="Opens calendar"andaccessibilityState={{ expanded: isModalVisible }}on the input (https://github.com/Expensify/App/blob/main/src/components/DatePicker/index.tsx#L140-L161). Rejected —accessibilityHintis read on focus, before the modal opens, and theexpandedstate produces "expanded"/"collapsed" instead of the "Calendar opened" copy in the bug report. Useful as a small additive cue but doesn't satisfy the expected behavior.Demo
Screen.Recording.2026-05-23.at.14.44.44.mov
melvin-bot commentedon May 23, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)wildan-m commentedon May 23, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
With VoiceOver enabled, opening the date picker on Account > Profile > Date of birth does not announce "calendar opened". The announcement is missing on macOS (Chrome/Safari) and on the iOS app. Note that Android and Windows are not affected — only the two platforms that use VoiceOver.
What is the root cause of that problem?
The "calendar opened" announcement is wired up correctly in the DatePicker. When the modal becomes visible it calls the accessibility-announcement hook:
App/src/components/DatePicker/index.tsx
Lines 45 to 46 in 2fac812
The problem is in the hook implementations, and it is specific to VoiceOver. That is why only macOS (Chrome/Safari) and iOS are reported, while Android (TalkBack) and Windows (NVDA/Narrator) work — those screen readers don't share VoiceOver's restriction.
Web (macOS VoiceOver). The web hook places the announcement inside a freshly-created
aria-livewrapper, and it both creates the wrapper and fills it with the message in the samesetTimeoutcallback:App/src/hooks/useAccessibilityAnnouncement/index.ts
Lines 76 to 87 in 2fac812
getWrapper()was deliberately moved inside this timeout so the modal'saria-modal="true"DOM is mounted before the wrapper is positioned (this fixed Android web in a prior PR). But VoiceOver on macOS only announces a live region whose content changes after the region already existed in the accessibility tree. A live region that is inserted into the DOM and populated in the same tick is silently ignored — so VoiceOver never speaks the message. TalkBack/NVDA do not have this restriction, which matches the affected-platform list exactly.iOS (VoiceOver). The iOS hook announces with the non-queued API:
App/src/hooks/useAccessibilityAnnouncement/index.ios.ts
Lines 28 to 30 in 2fac812
When the date picker popover mounts, VoiceOver shifts focus into the new modal and speaks the focused element. Because
announceForAccessibilityis fire-and-forget with no queueing, that focus-driven utterance preempts and drops the "calendar opened" announcement.What changes do you think we should make in order to solve the problem?
Fix each VoiceOver path while preserving the existing Android/Windows behavior:
Web hook (
src/hooks/useAccessibilityAnnouncement/index.ts): split the single-tick logic into two phases so the live region exists before its content changes. Inside thesetTimeout, first obtain/append the emptyaria-livewrapper (keeping it inside the timeout so the modal DOM is already mounted, which preserves the Android fix), then defer writing the message into that wrapper by one more frame usingrequestAnimationFrame(or a short nested timeout). This guarantees VoiceOver has registered the live region before the text mutation arrives, so the change is announced. Android/Windows are unaffected because their screen readers announce the mutation regardless of ordering.iOS hook (
src/hooks/useAccessibilityAnnouncement/index.ios.ts): replace the non-queuedAccessibilityInfo.announceForAccessibility(message)call withAccessibilityInfo.announceForAccessibilityWithOptions(message, {queue: true}). Queueing makes the announcement play after VoiceOver finishes the modal's focus announcement instead of being discarded by it. The existing 100ms tree-sync delay can stay.No change is needed in
DatePicker/index.tsx— the announcement string and trigger are already correct; only the delivery in the two VoiceOver hooks needs fixing.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/91502-voiceover-calendar-announcement?expand=1
What alternative solutions did you explore? (Optional)
For iOS, simply increasing
DELAY_FOR_ACCESSIBILITY_TREE_SYNCso the announcement fires after the focus shift was considered, but that is timing-fragile across devices and animation speeds;{queue: true}is the deterministic fix.For web, mounting a single persistent
aria-liveregion once (e.g. at app root) instead of creating it on demand would also work, but it is a broader change to the shared hook and risks affecting other consumers; the two-phase create-then-populate approach is the minimal, localized fix.[-]Account - The date picker modal is not announced as "calendar opened"[/-][+][$250] Account - The date picker modal is not announced as "calendar opened"[/+]melvin-bot commentedon May 23, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022058117265184404393
lxyct825-ops commentedon May 23, 2026
Contributor details
Your Expensify account email: lxyct825+expensify@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01174eaf71ab8fc150
16 remaining items
melvin-bot commentedon May 28, 2026
@ZhenjaHorbach Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon May 30, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Jun 1, 2026
@ZhenjaHorbach 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!
melvin-bot commentedon Jun 3, 2026
@ZhenjaHorbach 10 days overdue. I'm getting more depressed than Marvin.
truph01 commentedon Jun 3, 2026
@mountiny Could you assign this issue to me?
It wasn't included in my K2 list, so it's possible that I missed it.
rushatgabhane commentedon Jun 4, 2026
Hold on, there is some disagreement between QA on what to do. They don't want the calendar to open automatically ever
Please hold work on this as we might have to close this issue