File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,25 @@ const isTouchResponder = (element?: ReactTestInstance) => {
17
17
return ! ! element ?. props . onStartShouldSetResponder || isTextInput ( element ) ;
18
18
} ;
19
19
20
+ const isPointerEventEnabled = ( element ? : ReactTestInstance ) => {
21
+ if (
22
+ element ?. props . pointerEvents === 'none' ||
23
+ element ?. props . pointerEvents === 'box-only'
24
+ ) {
25
+ return false ;
26
+ }
27
+
28
+ if ( ! element ?. parent ) return true ;
29
+
30
+ return isPointerEventEnabled ( element . parent ) ;
31
+ } ;
32
+
20
33
const isEventEnabled = (
21
34
element ? : ReactTestInstance ,
22
35
touchResponder ? : ReactTestInstance
23
36
) => {
24
37
if ( isTextInput ( element ) ) return element ?. props . editable !== false ;
38
+ if ( ! isPointerEventEnabled ( element ) ) return false ;
25
39
26
40
const touchStart = touchResponder ?. props . onStartShouldSetResponder ?. ( ) ;
27
41
const touchMove = touchResponder ?. props . onMoveShouldSetResponder ?. ( ) ;
You can’t perform that action at this time.
0 commit comments