Skip to content

Commit

Permalink
Fix #3171: ScrollPanel Cannot scroll inside dialog (#3282)
Browse files Browse the repository at this point in the history
* Fixed bugs  when converting from class comp. to functional comp.

* fix: apply prettier.

Co-authored-by: Melloware <[email protected]>
  • Loading branch information
habubey and melloware authored Sep 12, 2022
1 parent 2ff2d76 commit 419255b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/scrollpanel/ScrollPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ export const ScrollPanel = React.forwardRef((props, ref) => {
};

const onDocumentMouseMove = (event) => {
if (isXBarClicked) {
if (isXBarClicked.current) {
onMouseMoveForXBar(event);
} else if (isYBarClicked) {
} else if (isYBarClicked.current) {
onMouseMoveForYBar(event);
} else {
onMouseMoveForXBar(event);
Expand All @@ -105,7 +105,7 @@ export const ScrollPanel = React.forwardRef((props, ref) => {

const onMouseMoveForYBar = (event) => {
const deltaY = event.pageY - lastPageY.current;
lastPageY.current = e.pageY;
lastPageY.current = event.pageY;

frame.current = window.requestAnimationFrame(() => {
contentRef.current.scrollTop += deltaY / scrollYRatio.current;
Expand Down

0 comments on commit 419255b

Please sign in to comment.