Skip to content

Commit

Permalink
fix: fix WindowScrolling class
Browse files Browse the repository at this point in the history
  • Loading branch information
wildergd committed Oct 12, 2020
1 parent 0a3c1c4 commit db793d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/Picklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ class Picklist extends Component {
if (!wasOpen && isOpen) {
this.outsideClick.startListening(this.containerRef.current, () => this.closeMenu());
this.windowScrolling.startListening(this.handleWindowScroll);
} else if (wasOpen && !isOpen) {
this.windowScrolling.stopListening();
}
}

Expand Down Expand Up @@ -124,6 +122,7 @@ class Picklist extends Component {

closeMenu() {
this.outsideClick.stopListening();
this.windowScrolling.stopListening();
this.setState({
isOpen: false,
});
Expand Down
2 changes: 1 addition & 1 deletion src/libs/scrollController/windowScrolling.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class WindowScrolling {
[privateHandleScroll](event) {
if (!this.isTicking) {
window.requestAnimationFrame(() => {
this.callback(this.callback(this, event));
this.callback(this, event);
this.isTicking = false;
});
this.isTicking = true;
Expand Down

0 comments on commit db793d2

Please sign in to comment.