File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,11 @@ const HOST_SWITCH_NAMES = ['RCTSwitch'];
9
9
const HOST_SCROLL_VIEW_NAMES = [ 'RCTScrollView' ] ;
10
10
const HOST_MODAL_NAMES = [ 'Modal' ] ;
11
11
12
- export type HostText = HostTestInstance & {
13
- type : 'Text' ;
14
- } ;
15
-
16
12
/**
17
13
* Checks if the given element is a host Text element.
18
14
* @param element The element to check.
19
15
*/
20
- export function isHostText ( element : ReactTestInstance ) : element is HostText {
16
+ export function isHostText ( element : ReactTestInstance ) : element is HostTestInstance {
21
17
return typeof element ?. type === 'string' && HOST_TEXT_NAMES . includes ( element . type ) ;
22
18
}
23
19
@@ -30,7 +26,7 @@ export type HostTextInput = HostTestInstance & {
30
26
* Checks if the given element is a host TextInput element.
31
27
* @param element The element to check.
32
28
*/
33
- export function isHostTextInput ( element : ReactTestInstance ) : element is HostTextInput {
29
+ export function isHostTextInput ( element : ReactTestInstance ) : element is HostTestInstance {
34
30
return typeof element ?. type === 'string' && HOST_TEXT_INPUT_NAMES . includes ( element . type ) ;
35
31
}
36
32
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ const basePress = async (
51
51
return ;
52
52
}
53
53
54
- if ( isHostPressable ( element ) ) {
54
+ if ( ! isHostTextInput ( element ) && isHostPressable ( element ) ) {
55
55
await emitTextPressEvents ( config , element , options ) ;
56
56
return ;
57
57
}
@@ -106,7 +106,6 @@ const isHostPressable = (element: ReactTestInstance) => {
106
106
107
107
return (
108
108
isHostElement ( element ) &&
109
- ! isHostTextInput ( element ) &&
110
109
isPointerEventEnabled ( element ) &&
111
110
! element . props . disabled &&
112
111
hasPressEventHandler
You can’t perform that action at this time.
0 commit comments