20d ago

Can't scroll on Mobile

Hello, I need to scroll on my webpage and I have a Rive animation. Rive listens to my click because I trigger animation on click, but it blocks the scroll on my page whenever I try to scroll inside the iframe. The same thing happens when I load my .riv inside a canvas.

Is it normal ? How can I allow the scroll ?

Thanks

2 replies
12d ago

Hi, does this still happen when you toggle the isTouchScrollEnabled parameter when you initialize the Rive instance?

5d ago

It's working thank you :)

// Initialiser Rive
        const canvas = document.getElementById('rive-bottles');
        const r = new rive.Rive({
            src: "https://ucarecdn.com/f7f464e4-532b-4363-b5f2-3f34685f5721/",
            canvas: canvas,
            isTouchScrollEnabled: true,
            autoplay: true,
            stateMachines: "State Machine 1",
            
              onLoad: () => {
                // Prevent a blurry canvas by using the device pixel ratio
                r.resizeDrawingSurfaceToCanvas();
              },
              
              
        });

        window.addEventListener("resize", () => {
            r.resizeDrawingSurfaceToCanvas();
        }, false);