Repository navigation
Add AccessibilityInfo.isDifferentiateWithoutColorEnabled on iOS - #59178
camilopires wants to merge 1 commit into
Conversation
Reads UIAccessibilityShouldDifferentiateWithoutColor() and emits differentiateWithoutColorChanged when it changes. Android resolves to false. Adds Jest tests for the getter and the event wiring, and an RNTester row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @camilopires! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary:
Differentiate Without Color asks apps not to rely on colour alone, for example by adding icons or patterns to status colours and validation states. React Native apps can't currently detect this setting.
This adds
AccessibilityInfo.isDifferentiateWithoutColorEnabled()and adifferentiateWithoutColorChangedevent, following the existingisDarkerSystemColorsEnabledpattern. It readsUIAccessibilityShouldDifferentiateWithoutColor()and observesUIAccessibilityShouldDifferentiateWithoutColorDidChangeNotification. On Android, the method resolves tofalse.Discussion: react-native-community/discussions-and-proposals#1026
Changelog:
[IOS] [ADDED] -
AccessibilityInfo.isDifferentiateWithoutColorEnabled()anddifferentiateWithoutColorChangedTest Plan:
yarn jest packages/react-native/Libraries/Components/AccessibilityInfo: all tests passyarn flow-check: 0 errorsyarn lint: passesyarn build-types --validate: API snapshot up to dateyarn test-generated-typescriptandyarn test-typescript-legacy: passyarn format-check-cpp: passesOn an iPhone 18 Pro simulator running iOS 27.0: I flipped the setting in the simulator's Settings app with a throwaway XCUITest, not part of this PR, and read RNTester's Accessibility → "Check if the display options are enabled" row. RNTester stayed running the whole time, so the row could only update through the change event.