-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch Menu components to Pressable #2147
Conversation
…native into pressable-menu
This one will probably need to wait on both the RN 0.68 bump and the new next DefinitelyTyped package to update so we can get the over props with out TS yelling at us. Otherwise I can suppress the TS errors temporarily. |
I think the CI errors can be fixed after #2157 merges |
"Tested that hover/focus/press still work on macOS ContextualMenu." --> can you expand your description on your test cases here? keyboard accessibility, screenreader etc. |
Updated with notes about VoiceOver and keyboard accessibility. |
* Switch Menu components to use React Native Pressable * Change files * Update slots and snapshots * Use PressablePropsExtended * MenuItem*Info * Fix ci * snapshot * Update disabled behavor handling
Platforms Impacted
Description of changes
Helps to resolve #1035
Back in RN 0.62, we forked RN Core's Pressable, with the intention of eventually removing that fork. We've gone through the effort of updating React Native Core, Windows, Win32, macOS, and the DefinitelyTyped types to make sure that the upstream pressable supports all the hover/focus/press states and types we need. Let's complete this work by replacing our components one by one with Pressable.
Specifically, we should replace references of "useAsPressable" (which uses our fork) with "usePressableState" (which is designed to work with React Native's Pressable.
Verification
Tested that hover/focus/press still work on macOS ContextualMenu.
Tested that Menu items and disabled menu items are read correctly by VoiceOver
Tested that keyboarding accessibility still behaves as expected
Pull request checklist
This PR has considered (when applicable):