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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of onClick event for accessibilityRole="link" #1353

wants to merge 1 commit into
base: master


None yet
2 participants
Copy link

commented May 27, 2019

This is a extracted from #1348 in order to separate the discussion of the two issues.
By default onClick and other DOM based props are passed down to the element like divs, but not for links!

This is currently not in the documentation, but used in this example and in the official guides (here: onMouseEnter/Leave) from @necholas!

Using onClick is crucial when avoiding Touchables/ScrollViews in to not inherit issues from #1219. Mobile browsers already solve scroll-based issues if we use regular click events.
This PR aims to allow just that and fix the link handling, as all other RNW elements support the onClick.

This results in problems like:

 onClick={() => console.log('called')}
 onClick={() => console.log('never called')}
 accessibilityRole="link" // want to use for accessibility and SEO reasons

I hope that you hear me out. Thanks for the great library! 馃憤


This comment has been minimized.

Copy link

commented Jun 10, 2019

This is a great fix! Thanks @EyMaddis !

Any chance that this can get some attention from project maintainers @necolas ? We're having to fork react-native-web to apply this patch for our project. It'd be great to include this in the official version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.