File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,13 @@ const ScrollRenderer = (props: Props) => {
29
29
30
30
const onScroll = ( span : any ) => ( ) => {
31
31
requestAnimationFrame ( ( ) => {
32
- const startingPoint = span . parentNode . offsetTop + span . parentNode . offsetHeight ;
33
- const anchorPos = span . offsetTop - span . parentNode . scrollTop ;
32
+ if ( span ) {
33
+ const startingPoint = span . parentNode . offsetTop + span . parentNode . offsetHeight ;
34
+ const anchorPos = span . offsetTop - span . parentNode . scrollTop ;
34
35
35
- if ( anchorPos <= ( startingPoint + ( span . parentNode . offsetHeight * 2 ) ) ) {
36
- updateRenderInfo ( ) ;
36
+ if ( anchorPos <= ( startingPoint + ( span . parentNode . offsetHeight * 2 ) ) ) {
37
+ updateRenderInfo ( ) ;
38
+ }
37
39
}
38
40
} ) ;
39
41
} ;
@@ -58,7 +60,7 @@ const ScrollRenderer = (props: Props) => {
58
60
} ) ;
59
61
60
62
requestAnimationFrame ( ( ) => {
61
- if ( span . parentNode ) {
63
+ if ( span && span . parentNode ) {
62
64
span . parentNode . scrollTop = pos ;
63
65
}
64
66
} ) ;
You can’t perform that action at this time.
0 commit comments