Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3171: ScrollPanel Cannot scroll inside dialog #3282

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/lib/scrollpanel/ScrollPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ 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 {
Expand All @@ -109,7 +109,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