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

Can't scroll outside the ReactFullPage.Wrapper on Next.js #424

Open
mjenkins-fcb opened this issue Sep 21, 2023 · 4 comments
Open

Can't scroll outside the ReactFullPage.Wrapper on Next.js #424

mjenkins-fcb opened this issue Sep 21, 2023 · 4 comments
Labels
question Further information is requested

Comments

@mjenkins-fcb
Copy link

mjenkins-fcb commented Sep 21, 2023

Description

I am working with Next.js and trying to use React Fullpage on the homepage. Everything is set up and working however if I add content outside of the wrapper I am unable to scroll to it. If I grab the scrollbar and pull it down I can see the content, but it just gets snapped back up to the last panel in the wrapper.

Link to isolated reproduction with no external CSS / JS

edit reproduction here:
https://stackblitz.com/edit/nextjs-gwceuj?file=pages%2Findex.js

I wasn't sure how to set up a codesandbox for Next.js, but started a fresh Next.js project and added this to page.tsx:

"use client";
import ReactFullpage from "@fullpage/react-fullpage";

export default function Home() {
  return (
    <>
      <ReactFullpage
        credits={{ enabled: true }}
        scrollBar
        render={() => {
          return (
            <ReactFullpage.Wrapper>
              <div className="section">
                <p>hi</p>
              </div>
              <div className="section">
                <p>hi</p>
              </div>
              <div className="section">
                <p>hi</p>
              </div>
              <div className="section">
                <p>hi</p>
              </div>
            </ReactFullpage.Wrapper>
          );
        }}
      />
      <div style={{ height: "1800px" }}>OUTSIDE</div>
    </>
  );
}

Steps to reproduce it

  1. Setup Next.js app.
  2. Replace code in /src/app/page.tsx with the above
  3. Load the app.
  4. Try and scroll down the page past the bottom 'section'
@alvarotrigo
Copy link
Owner

The scroll beyond fullpage.js is not a fully working feature yet.
I'd recommend you to place that content inside the fullPage.js wrapper and use "scrollOverflow". This way you'll be able to scroll normally within the last section.

Otherwise, try removing these styles from yourreact-root wrapper.

style={{ height: '100%', position: 'relative' }} 

@alvarotrigo alvarotrigo added the question Further information is requested label Sep 21, 2023
@mjenkins-fcb
Copy link
Author

I had tried that with not much luck, I had it working in a pure React environment, but not when I use the same code in Next.js.

React version here:
https://codesandbox.io/s/nice-shadow-frxxkf?file=/src/App.js:98-172

Ideally I'd like the content outside of the fullPage.js wrapper as it is the footer and would like to keep it in the layout rather than the page so it can be used across all pages as opposed to having to render a new version for each page navigation.

@alvarotrigo
Copy link
Owner

It doesn't work in react using 0.1.40.
Probably a bug fix :)

As I said, the feature of scrolling beyond fullPage.js is not polished or ready to use.

@mjenkins-fcb
Copy link
Author

Ah I see - didn't spot the version differences. Thanks for flagging.

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

No branches or pull requests

2 participants