Skip to content

Commit

Permalink
fix: skipBlur option disables both endEditing and blur
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpmohiburrahman committed Nov 12, 2024
1 parent 1a8d080 commit 25005ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/user-event/type/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ export async function type(
dispatchEvent(element, 'submitEditing', EventBuilder.TextInput.submitEditing(finalText));
}

dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));

if (!options?.skipBlur) {
dispatchEvent(element, 'endEditing', EventBuilder.TextInput.endEditing(finalText));
dispatchEvent(element, 'blur', EventBuilder.Common.blur());
}
}
Expand Down Expand Up @@ -136,3 +135,4 @@ function isTextChangeAccepted(element: ReactTestInstance, text: string) {
const maxLength = element.props.maxLength;
return maxLength === undefined || text.length <= maxLength;
}

0 comments on commit 25005ae

Please sign in to comment.