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'];
99const HOST_SCROLL_VIEW_NAMES = [ 'RCTScrollView' ] ;
1010const 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments