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

refactor: address some deprecations warnings take 1/n #1804

Closed
wants to merge 23 commits into from

Conversation

ecreeth
Copy link

@ecreeth ecreeth commented Nov 3, 2023

  1. Replaced accessibilityRole with role
  2. Replaced accessibilityLabel with aria-label
  3. Replaced returnKeyType with enterKeyHint
  4. Replaced textAlignVertical with verticalAlign
  5. Replaced resizeMode with contentFit
  6. use id instead of testID for UserBanner
  7. Replaced search with searchbox for role prop
  8. use id instead of nativeId
  9. move pointerEvents prop to pointerEvents style
  10. replaced accessibilityLabelledBy with aria-labelledby

See react-native-web v0.19 deprecations for more information.

NOTE: : react-native-a11y is not aware of these accessibility props changes, if you try to run yarn lint --fix is going to add the accessibility* props even though we use aria-* and role props.

@ecreeth
Copy link
Author

ecreeth commented Nov 3, 2023

I'm planning to remove Touchable* components and use Pressable in another PR. Let me know if that is ok :)

Enter the address of your provider:
</Text>
<TextInput
accessibilityLabel="Text input field"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is added automatically by lint-staged

@gaearon
Copy link
Contributor

gaearon commented Nov 3, 2023

NOTE: : react-native-a11y is not aware of these accessibility props changes, if you try to run yarn lint --fix is going to add the accessibility* props even though we use aria-* and role props.

What's your plan for this?

I'm planning to remove Touchable* components and use Pressable in another PR. Let me know if that is ok :)

Do these have semantic differences (e.g. different tap handling logic)? If yes we'd need to make sure we don't regress any tapping behaviors. We already have some weirdness with gestures. So this needs to be tested with real devices.

@estrattonbailey estrattonbailey self-assigned this Nov 6, 2023
@pfrazee pfrazee assigned pfrazee and unassigned estrattonbailey Nov 7, 2023
@ecreeth
Copy link
Author

ecreeth commented Nov 7, 2023

What's your plan for this?

The only way for now is to patch react-native-a11y (I don't know if that is ok). The repo hasn't been updated since January. There's a PR FormidableLabs/eslint-plugin-react-native-a11y#150 that try to address the issue, but hasn't gained any response.

Do these have semantic differences (e.g. different tap handling logic)? If yes we'd need to make sure we don't regress any tapping behaviors. We already have some weirdness with gestures. So this needs to be tested with real devices.

This is quite difficult to answer. Both have different implementations trying to archive the same thing, but Pressable is the modern recommended way (it can handle onHover*, delayHover*, delayLongPress).

As you said, this need to be tested in physical devices. I'll provide more info once is implemented 🤞

@pfrazee
Copy link
Collaborator

pfrazee commented Nov 8, 2023

What's the situation with RN's use of accessibility* props vs aria-*? I couldn't find anything definitive about the difference, or why RNW deprecated the former

@ecreeth
Copy link
Author

ecreeth commented Nov 8, 2023

What's the situation with RN's use of accessibility* props vs aria-*?

They changed the name match web standard. accessibility* is deprecated in RNW but no in RN (should be in the future)

I couldn't find anything definitive about the difference, or why RNW deprecated the former

Here is the text: Reduce API fragmentation across platforms

@pfrazee pfrazee added the bugfix A PR that's fixing a bug label Jan 8, 2024
@ecreeth
Copy link
Author

ecreeth commented Jan 31, 2024

🚁 I'm going to close this PR for now. I'm going to split it into small ones.

@ecreeth ecreeth closed this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix A PR that's fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants