-
Notifications
You must be signed in to change notification settings - Fork 273
Make onPress more life-like #674
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
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.
Great addition, thank you!
Removed the throwing behaviour from invokeEvent here: #691 |
Mind rebasing? :) |
6cafc39
to
5247b6a
Compare
5247b6a
to
eeee8f7
Compare
@thymikee done :) |
Will this ever be merged? I need to be able to work with onFocus and I can't test it atm. |
@rarenatoe we'll take care of it, but have no timeline. In the meantime you can invoke |
Long term, shouldn't we try to to either create |
Closing in favour of #1119 which would be more organised approach that is also similar to RTL. |
Taking inspiration from user-event which tries to mimic the real event order when user interacts with an element.
Summary
fireEvent.press
currently only invoke theonPress
-handler, and this PR aim to make it more real-life-like by also invokingonPressIn
,onPressOut
andonFocus
if possible (silently failing if there are no registered handlers).Also adding
fireEvent.longPress
for convenience.Test plan
Test added in fireEvent.test.js
Thoughts
One could discuss that this should be another method called
tap
or something else that map closer to user intent than to event handler name. Looking forward to hear your feedback.