This repository was archived by the owner on Feb 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ export default class PointerEventsView extends React.Component<Props> {
2727 this . props . active ? TRUE : FALSE
2828 ) ;
2929
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+
3037 private exec = block ( [
3138 cond (
3239 greaterThan ( this . props . progress , MIN_PROGRESS ) ,
@@ -40,13 +47,17 @@ export default class PointerEventsView extends React.Component<Props> {
4047 onChange (
4148 this . pointerEventsEnabled ,
4249 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 ) ) ;
4651 } )
4752 ) ,
4853 ] ) ;
4954
55+ private setPointerEventsEnabled = ( enabled : boolean ) => {
56+ const pointerEvents = enabled ? 'box-none' : 'none' ;
57+
58+ this . root && this . root . setNativeProps ( { pointerEvents } ) ;
59+ } ;
60+
5061 private root : View | null = null ;
5162
5263 render ( ) {
You can’t perform that action at this time.
0 commit comments