Skip to content
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

useFocus does not seem to work in the iOS simulator (tested with VoiceOver) #100

Open
lgibso34 opened this issue May 26, 2023 · 1 comment

Comments

@lgibso34
Copy link
Contributor

lgibso34 commented May 26, 2023

Sample git repo
Snack that doesn't work because it can't install react-native-ama but it is the example from the docs.

I have tried to use useFocus on two different projects (and machines), and neither work with the IOS simulator. I built a further third project and was able to run it on my personal iPhone with voiceover and it seemed to work. It does seem to work on a physical device fine.

Is there anything that can be done about this for those of us who use the IOS simulator as their primary development device?

I even copy/pasted the useFocus code and tried it as a standalone hook since it doesn't rely on anything from the <AMAProvider>. Same thing.

Any help would be appreciated.
Thank you!

Additional question:
Why is AccessibilityInfo.setAccessibilityFocus(elementId); ran twice in useFocus?

@ceceppa
Copy link
Member

ceceppa commented Aug 1, 2023

Hi,
I'm not sure useFocus can be made working on Simulator; I need to investigate this.
React Nativa AMA doesn't work with expo go. I'm splittin the library into separate components and hooks, so you can use all the parts that do not require any native module.
Why AccessibilityInfo.setAccessibilityFocus(elementId); twice? Because a bug in React Native forces you to do so: https://stackoverflow.com/questions/63252638/setaccessibilityfocus-using-ref-not-working

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

No branches or pull requests

2 participants