Skip to content

Commit eeff5ff

Browse files
mrpmohiburrahmanmdjastrzebski
authored andcommitted
feat: add skip blur option
1 parent 393d84c commit eeff5ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/user-event/type/type.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { parseKeys } from './parse-keys';
1212
export interface TypeOptions {
1313
skipPress?: boolean;
1414
submitEditing?: boolean;
15+
skipBlur?: boolean;
1516
}
1617

1718
export async function type(
@@ -69,7 +70,9 @@ export async function type(
6970

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

72-
dispatchEvent(element, 'blur', EventBuilder.Common.blur());
73+
if (!options?.skipBlur) {
74+
dispatchEvent(element, 'blur', EventBuilder.Common.blur());
75+
}
7376
}
7477

7578
type EmitTypingEventsContext = {

0 commit comments

Comments
 (0)