Skip to content

feat: support pointerEvents - #655

Merged
thymikee merged 6 commits into
masterfrom
feat/supportPointerEvents
Feb 5, 2021
Merged

feat: support pointerEvents#655
thymikee merged 6 commits into
masterfrom
feat/supportPointerEvents

Conversation

@suezzo

@suezzo suezzo commented Jan 21, 2021

Copy link
Copy Markdown
Contributor

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
Comment thread src/fireEvent.js Outdated
@thymikee

Copy link
Copy Markdown
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

@satya164 satya164 left a comment

Copy link
Copy Markdown
Member

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

suezzo commented Jan 21, 2021

Copy link
Copy Markdown
Contributor Author

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
@thymikee
thymikee requested a review from satya164 January 26, 2021 10:49
Comment thread src/__tests__/fireEvent.test.js Outdated

@satya164 satya164 left a comment

Copy link
Copy Markdown
Member

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