Skip to content

Commit 9004447

Browse files
committed
feat: 🎸 use window resize in ViewportScrollSensor
1 parent cb2990b commit 9004447

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/ViewportScrollSensor/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ export class ViewportScrollSensor extends React.Component<IViewportScrollSensorP
7979
this.mounted = true;
8080

8181
on(document, 'scroll', this.onScroll);
82+
on(window, 'resize', this.onScroll);
8283
this.onScroll();
8384
}
8485

8586
componentWillUnmount () {
8687
this.mounted = false;
8788

8889
off(document, 'scroll', this.onScroll);
90+
off(window, 'resize', this.onScroll);
8991
}
9092

9193
onCalculation (visible, rectRoot: TRect, rectEl: TRect, rectIntersection: TRect) {

0 commit comments

Comments
 (0)