-
Notifications
You must be signed in to change notification settings - Fork 179
Only set userSelect:auto on anchor tags (native) #324
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
Conversation
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
workflow: benchmarks/perf (native)Comparison of performance test results, measured in operations per second. Larger is better.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done some practical checks, and:
- on iOS: neither
onPress
noruserSelect
style triggers keyboard navigation focus. WrappingText
inPressable
(or simply<View accessible>
) allows for focusing the text. However, when nesting that insideText
you get whacky layout.
- on Android: having
onPress
prop alone is sufficient forText
component to receive keyboard navigation focus (being wrapped inPressable
is also fine)
Therefore, I would recommend on not applying userSelect: auto
to a
elements, as:
- it's not needed on Android, having
onPress
prop is enough - it does not work on iOS anyway
- AFAIU the purpose of
userSelect
style is to allow for user to copy given text, not to make it focusable by keyboard, that would betabIndex
/focusable
props (but these work only on Android anyway)
You can check the experiements repo here: https://github.com/mdjastrzebski/repro-rsd-keyboard-navigation
8efcd35
to
560a273
Compare
Updated to remove it entirely |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Looks Good! Thank you for fixing it.
Fix #314