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: add skip blur option #1704

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mrpmohiburrahman
Copy link

Summary

Resolves: #1677

Test plan

All tests pass

Copy link
Member

@mdjastrzebski mdjastrzebski left a 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) {
Copy link
Member

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.

Copy link
Author

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.

@mrpmohiburrahman
Copy link
Author

I've left comment about events affected by this flag. Please add also documentation entry for the option.

Could you guide me on where to place the documentation entry for the skipBlur option?

@mdjastrzebski
Copy link
Member

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 skipBlur option set.

@mrpmohiburrahman
Copy link
Author

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 skipBlur option set.

Hi, @mdjastrzebski ,

I have updated doc and added unit test.
please, check.
Also note that, I am very new to this.

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.

Support skipBlur in the type() user event
2 participants