This repository was archived by the owner on Feb 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ export default class PointerEventsView extends React.Component<Props> {
27
27
this . props . active ? TRUE : FALSE
28
28
) ;
29
29
30
+ componentDidUpdate ( prevProps : Props ) {
31
+ if ( this . props . active !== prevProps . active ) {
32
+ this . pointerEventsEnabled . setValue ( this . props . active ? TRUE : FALSE ) ;
33
+ this . setPointerEventsEnabled ( this . props . active ) ;
34
+ }
35
+ }
36
+
30
37
private exec = block ( [
31
38
cond (
32
39
greaterThan ( this . props . progress , MIN_PROGRESS ) ,
@@ -40,13 +47,17 @@ export default class PointerEventsView extends React.Component<Props> {
40
47
onChange (
41
48
this . pointerEventsEnabled ,
42
49
call ( [ this . pointerEventsEnabled ] , ( [ value ] ) => {
43
- const pointerEvents = this . props . active && value ? 'box-none' : 'none' ;
44
-
45
- this . root && this . root . setNativeProps ( { pointerEvents } ) ;
50
+ this . setPointerEventsEnabled ( Boolean ( this . props . active && value ) ) ;
46
51
} )
47
52
) ,
48
53
] ) ;
49
54
55
+ private setPointerEventsEnabled = ( enabled : boolean ) => {
56
+ const pointerEvents = enabled ? 'box-none' : 'none' ;
57
+
58
+ this . root && this . root . setNativeProps ( { pointerEvents } ) ;
59
+ } ;
60
+
50
61
private root : View | null = null ;
51
62
52
63
render ( ) {
You can’t perform that action at this time.
0 commit comments