Skip to content

Commit

Permalink
Fix an issue where dragging while the page has no scrollbar results i…
Browse files Browse the repository at this point in the history
…n a console error (#23666)
  • Loading branch information
talldan authored Jul 8, 2020
1 parent 55279e8 commit 0124a9f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export default function useScrollWhenDragging() {
}, [] );

const scrollOnDragOver = useCallback( ( event ) => {
if ( ! scrollParentY.current ) {
return;
}
const scrollParentHeight = scrollParentY.current.offsetHeight;
const offsetDragStartPosition =
dragStartY.current - scrollParentY.current.offsetTop;
Expand Down

0 comments on commit 0124a9f

Please sign in to comment.