Skip to content

Commit ebd14cb

Browse files
committed
.
1 parent d75cbe1 commit ebd14cb

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/helpers/host-component-names.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ const HOST_SWITCH_NAMES = ['RCTSwitch'];
99
const HOST_SCROLL_VIEW_NAMES = ['RCTScrollView'];
1010
const HOST_MODAL_NAMES = ['Modal'];
1111

12-
export type HostText = HostTestInstance & {
13-
type: 'Text';
14-
};
15-
1612
/**
1713
* Checks if the given element is a host Text element.
1814
* @param element The element to check.
1915
*/
20-
export function isHostText(element: ReactTestInstance): element is HostText {
16+
export function isHostText(element: ReactTestInstance): element is HostTestInstance {
2117
return typeof element?.type === 'string' && HOST_TEXT_NAMES.includes(element.type);
2218
}
2319

@@ -30,7 +26,7 @@ export type HostTextInput = HostTestInstance & {
3026
* Checks if the given element is a host TextInput element.
3127
* @param element The element to check.
3228
*/
33-
export function isHostTextInput(element: ReactTestInstance): element is HostTextInput {
29+
export function isHostTextInput(element: ReactTestInstance): element is HostTestInstance {
3430
return typeof element?.type === 'string' && HOST_TEXT_INPUT_NAMES.includes(element.type);
3531
}
3632

src/user-event/press/press.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const basePress = async (
5151
return;
5252
}
5353

54-
if (isHostPressable(element)) {
54+
if (!isHostTextInput(element) && isHostPressable(element)) {
5555
await emitTextPressEvents(config, element, options);
5656
return;
5757
}
@@ -106,7 +106,6 @@ const isHostPressable = (element: ReactTestInstance) => {
106106

107107
return (
108108
isHostElement(element) &&
109-
!isHostTextInput(element) &&
110109
isPointerEventEnabled(element) &&
111110
!element.props.disabled &&
112111
hasPressEventHandler

0 commit comments

Comments
 (0)