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

ScrollControls on iOS #1976

Open
klader-digital opened this issue Jun 3, 2024 · 0 comments
Open

ScrollControls on iOS #1976

klader-digital opened this issue Jun 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@klader-digital
Copy link

klader-digital commented Jun 3, 2024

  • three version: ^0.164.1
  • @react-three/fiber version: ^8.16.7,
  • @react-three/drei version: ^9.106.0
  • node version: 22.1.0
  • npm (or yarn) version: 10.7.0

Problem description:

When making use of the infinite scroll feature of ScrollControls on iPhone (iOS), it seems to be uncontrollable when scrolling towards the top of the screen (see media).

Relevant code:

https://codesandbox.io/embed/pmkh9n

function App() {
    return (
        <Canvas camera={{position: [0, 0, 10], fov: 15}}>
            <ScrollControls
                infinite
                pages={16}
            >
                <Carousel/>
            </ScrollControls>
        </Canvas>
    )
}

function Carousel(props) {
    const ref = useRef()
    const scroll = useScroll()

    useFrame((state, delta) => {
        ref.current.rotation.z = -scroll.offset * (Math.PI * 2) // Rotate contents
    })

    return (
        <group ref={ref} {...props}>
            <mesh>
                <planeGeometry args={[1, 1]}/>
                <meshBasicMaterial
                    color={'#000000'}
                />
            </mesh>
        </group>
    )
}
bug_scrollcontrols_ios.mp4
@klader-digital klader-digital added the bug Something isn't working label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant