drei
drei copied to clipboard
ScrollControls bug
"@emailjs/browser": "^4.3.3", "@react-three/drei": "^9.102.6", "@react-three/fiber": "^8.15.19", "framer-motion": "^11.0.20", "gsap": "^3.12.5", "maath": "^0.10.7", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.22.3", "react-tilt": "^1.0.2", "react-vertical-timeline-component": "^3.6.0", "three": "^0.162.0"
Problem description:
I use scroll control
<ScrollControls pages={6} damping={0.1} enabled={toggle ? false : true}>
when I open modal I "block" scroll, as you can see, but there is a problem:
I open modal, if I try to scroll up or down, the 3D model doesn't move, but when I close modal, and scroll up, the scroll goes fast and the model move fast.
I think that if enabled is false, and try to scroll ( scroll don't work ) the pageYOffset or position or anything else continue to calculate scroll position, and when enabled returns true, happened this, for example if I set enabled false scroll block to Y 100, and try to scroll, it's continue calculate Y scroll, for example Y 250 ( but 3D model and scroll bar doesn't move ), when enabled return true and try to scroll the 3D model and scrollbar move fast to current Y is possible?