Skip to content

feat(renderer): add aria-modal prop - #877

Open
patrickkabwe wants to merge 1 commit into
feat/a11y-actionsfrom
feat/a11y-modal
Open

patrickkabwe wants to merge 1 commit into
feat/a11y-actionsfrom
feat/a11y-modal

Conversation

@patrickkabwe

@patrickkabwe patrickkabwe commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #838 (step 8). Stacked on #874.

Views take aria-modal, so screen readers ignore the view's siblings while it's shown, such as the screen behind a custom alert.

<View layout={{ flex: 1 }}>
  <Inbox />
  {confirming && (
    <View aria-modal aria-label="Delete message?" layout={{ position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 }}>
      <ConfirmDialog />
    </View>
  )}
</View>
  • iOS: maps to accessibilityViewIsModal.
  • Android has no equivalent, so this matches iOS: while the view is attached, its siblings are marked IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, and their previous values are restored when the prop is cleared or the view detaches. Props are set before React adds the view to its parent, so hiding waits for the attach. The view's label also becomes its pane title, which TalkBack announces. Siblings added while the view is shown stay visible. The attach listener is only created for views that use the prop.
  • Navigation sheets already trap focus on both platforms. iOS presents them with dimmed detents, and Android shows them in a BottomSheetDialog window, so nothing changes there.
  • The modal screen in the example asks for confirmation before "Close all" in an overlay that uses the prop.

Tested on the iOS simulator and the Android emulator: with a sheet open, the accessibility tree only contains the sheet. On Android, the compressed uiautomator tree drops the items behind the overlay while it's shown and brings them back after "Cancel". On iOS, the external accessibility query used for testing doesn't apply VoiceOver's accessibilityViewIsModal filtering, so iOS was only checked as far as the prop reaching the view. The Android pane title wasn't checked separately. TalkBack and VoiceOver themselves were not run.

Re-tested after the move to ARIA names and the rebase onto main: with the aria-modal overlay open, the compressed Android tree only holds the overlay, and the list comes back after "Cancel".

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nitro-ui-docs Ready Ready Preview Dec 2, 2026 1:35pm UTC

Request Review

@patrickkabwe patrickkabwe changed the title feat(renderer): add accessibilityViewIsModal prop feat(renderer): add aria-modal prop Dec 2, 2026
@patrickkabwe
patrickkabwe added this pull request to stack #951 December 2, 2026 13:39
@patrickkabwe
patrickkabwe marked this pull request as ready for review December 2, 2026 13:39
@patrickkabwe
patrickkabwe requested a review from hannojg December 2, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant