Conversation
The `@expo/ui/swift-ui` modifier set ships `accessibilityLabel`,
`accessibilityHint`, and `accessibilityValue` but not
`accessibilityHidden`, SwiftUI's way to drop a decorative view from the
accessibility tree since iOS 14. Without it, a presentational icon
either gets announced by VoiceOver or has to be silenced by overloading
`accessibilityLabel` with the surrounding heading, which is redundant.
Adds an `accessibilityHidden` modifier mirroring the three existing
accessibility modifiers: an `AccessibilityHiddenModifier`
(`ViewModifier, Record`) registered in `ViewModifierRegistry.swift`. The
argument defaults to `true`. `false` is meaningful, not a no-op: it
overrides a hidden state inherited from an ancestor, so
`content.accessibilityHidden(hidden)` is applied unconditionally,
matching SwiftUI.
```tsx
import { Host, HStack, Image, Text } from '@expo/ui/swift-ui';
import { accessibilityHidden } from '@expo/ui/swift-ui/modifiers';
<Host matchContents>
<HStack>
<Image systemName="exclamationmark.triangle" modifiers={[accessibilityHidden(true)]} />
<Text>Something went wrong</Text>
</HStack>
</Host>
```
VoiceOver skips the decorative symbol and starts at "Something went
wrong". No JS bridge, type, or API surface beyond the new modifier.
# Test Plan
Smoke-tested on iPhone 17 Pro simulator (iOS 26.5, Xcode 26.5) via
`apps/native-component-list`:
- `pnpm build`, `pnpm lint --max-warnings 0`, `pnpm test` (13 suites, 66
tests), and `pnpm exec tsc --noEmit` all green in `packages/expo-ui`.
- `et generate-docs-api-data -p expo-ui` regenerated the unversioned
`expo-ui/swift-ui/modifiers.json` to add the `accessibilityHidden`
entry. Output matches what's committed, nothing else changed.
- Modifiers screen adds a decorative `exclamationmark.triangle` next to
a "Something went wrong" label. Querying the rendered accessibility
tree, the symbol (auto-labelled "Warning") is present with
`accessibilityHidden(false)` and absent with
`accessibilityHidden(true)`, while "Something went wrong" stays in both.
So the icon drops out of VoiceOver traversal with no change to the
visible layout.
# Checklist
- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- Not applicable: no module plugin touched.
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
# Why Fixes - #46573 One more case where it makes sense to set ignoreSafeArea="all" as a default value in `Host` on iOS. We have seen similar issues in the past. The safe area insets added by `Host` creates issues when we put SwiftUI views in an RN view that goes beyond safe area view. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How ignore safe area view in universal SegmentedControl. Other components are worth visiting, and maybe making `ignoreSafeArea="all"` as a default in Host also makes sense. # Test Plan Tested the repro shared by user <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [ ] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )