-
Notifications
You must be signed in to change notification settings - Fork 273
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: add skip blur option #1704
base: main
Are you sure you want to change the base?
feat: add skip blur option #1704
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.
I've left comment about events affected by this flag. Please add also documentation entry for the option.
@@ -69,7 +70,9 @@ export async function type( | |||
|
|||
dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText)); | |||
|
|||
dispatchEvent(element, 'blur', EventBuilder.Common.blur()); | |||
if (!options?.skipBlur) { |
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.
skip blur option should disable both endEditing and blur together, as in in native platforms (iOS, android) they always happen together.
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.
Made the changes on the latest commit.
Could you guide me on where to place the documentation entry for the skipBlur option? |
Document to update: https://github.com/callstack/react-native-testing-library/blob/main/website/docs/12.x/docs/api/events/user-event.mdx. Please also add units test(s) for behavior with |
Hi, @mdjastrzebski , I have updated doc and added unit test. |
Summary
Resolves: #1677
Test plan
All tests pass