deanhet / react-native-text-ticker

React Native Text Ticker/Marquee Component
MIT License
444 stars 75 forks source link

Add ability to make <TextTicker> inaccessible to screen readers #109

Open mitchdowney opened 3 years ago

mitchdowney commented 3 years ago

I'm trying to make the TextTicker not gain focus on Android when using a screen reader, but it doesn't look like TextTickerProps provides the option to override the accessible and importantForAccessibility props. Is it possible to make TextTicker inaccessible? Or would that need to be a new feature?

We have the accessibility text for our TextTicker set elsewhere in the UI when a screen reader is enabled, so it would be useful to prevent the TextTicker from gaining focus by the screenreader.

Thanks for writing this component. Other than this one thing it has worked perfectly for us.

deanhet commented 3 years ago

I don't see any reason why the current code shouldn't just work: https://github.com/deanhet/react-native-text-ticker/blob/7dfc8e654a79591b633e2cfd01376918d8e870ae/index.js#L360

As I've linked, props that are passed to a normal text component are just passed straight through to the underlying text component of the the ticker. There's no magic to remove the props you've mentioned. Does your use case work with just a normal text component in its place instead?