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

Use without data-scroll-container #1

Open
opr-inzn opened this issue Jan 6, 2023 · 0 comments
Open

Use without data-scroll-container #1

opr-inzn opened this issue Jan 6, 2023 · 0 comments

Comments

@opr-inzn
Copy link

opr-inzn commented Jan 6, 2023

I'm also using GSAP’s scrolltrigger which does not allow for the use of any data-scroll attributes. If I remove data-scroll-container from _app.tsx, however, it breaks the Locomotive Scroll and returns "Cannot read properties of null (reading 'offsetHeight'). I have instead already applied the "el" option:

<LocomotiveScrollProvider
        options={{
          el: containerRef.current,
          smooth: true,
        smartphone: {
          smooth: true,
        },
        tablet: {
          smooth: true,
        },
        }}
        watch={[]}
        location={asPath}
      onLocationChange={(scroll: any) =>
        scroll.scrollTo(0, { duration: 0, disableLerp: true })
      }
      
      containerRef={containerRef}
      >
              <div ref={containerRef}>

but that doesn't seem to work either. Is there another way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant