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

feat: support pointerEvents #655

Merged
merged 6 commits into from
Feb 5, 2021
Merged

feat: support pointerEvents #655

merged 6 commits into from
Feb 5, 2021

Conversation

suezzo
Copy link
Contributor

@suezzo suezzo commented Jan 21, 2021

Summary

This PR allows handling test cases that use pointerEvents which was mentioned in #650. I'm not sure if we should also additionally handle the box-none value.

Fixes #650

Test plan

I've added 3 tests that check pointerEvents none and box-only and also pointerEvents none with nested views.

@suezzo suezzo changed the title Feat/support pointer events feat: support pointerEvents Jan 21, 2021
@suezzo suezzo requested a review from thymikee January 21, 2021 11:14
src/fireEvent.js Outdated Show resolved Hide resolved
@thymikee
Copy link
Member

Let's support box-none as well. It would be subpar experience to provide only partial support. So let's implement all cases specified here: https://reactnative.dev/docs/view#pointerevents

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Can you also add tests for following scenarios:

  • Firing event on the same element which has pointerEvents="none" (<Text onPress={handlePress} pointerEvents="none" />)
  • Firing event on the same element which has pointerEvents="box-none" (<Text onPress={handlePress} pointerEvents="box-none" />)
  • Firing event on the same element which has pointerEvents="box-only" (<Text onPress={handlePress} pointerEvents="box-only" />)

@suezzo
Copy link
Contributor Author

suezzo commented Jan 21, 2021

I don't think that <Text /> accepts pointerEvents prop. It's not mentioned in the docs - https://reactnative.dev/docs/textinput and type checker has a problem with it. Correct me if I'm wrong but only <View /> component has pointerEvents prop?

@suezzo suezzo requested review from thymikee and removed request for thymikee January 25, 2021 16:16
Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

I think it would still be nice to have some tests which trigger onPress on the same element that has pointerEvents

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

Successfully merging this pull request may close these issues.

Add support for pointerEvents
3 participants