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

Continuous Manager inside an element that is scrolling that is not the viewport? #1372

Open
benlieb opened this issue Feb 13, 2024 · 0 comments

Comments

@benlieb
Copy link

benlieb commented Feb 13, 2024

It appears that this code (node_modules/epubjs/lib/managers/continuous/index.js):

  observeIfChapterIsInView(view) {
    const observer = new IntersectionObserver(entries => {
      if (entries[0].isIntersecting === true) {
        setTimeout(() => {
          if (this.readingDirection === 'backward') {
            this.observeMovingBack();
          } else {
            this.observeMovingForward();
          }
        }, 500);
      }
    }, {
      threshold: [1]
    });
    observer.observe(view.element);
  }

Means that the continuous scrolling only works when the scrolling element is is the viewport (default since no root is passed explicitly).

Is there an easy way for me to get this to work when the EPUB is rendered into an element that is scrolling that is not the viewport?

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