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

Scroll two slides at once #30

Open
julianStreibel opened this issue Oct 2, 2019 · 8 comments
Open

Scroll two slides at once #30

julianStreibel opened this issue Oct 2, 2019 · 8 comments

Comments

@julianStreibel
Copy link

julianStreibel commented Oct 2, 2019

Hi, Im having an issue with scrolling.
When I scroll on my Phone everything works fine.
On my Mac I can't scroll as usually because it scrolls two sides.
When I scroll just very little everything works fine.

@Newbornbird
Copy link

I have the same problems!

@VikLiegostaiev
Copy link
Owner

Hi @julianStreibel what browser did u use? Just tried on mac - everything works fine both in chrome and safari, it scrolls as it should, can u provide the demo screen recording?

@julianStreibel
Copy link
Author

julianStreibel commented Nov 5, 2019

This problem occurs both in Firefox and Safari.
Recorded in Firefox.
I use the Trackpad and the Apple Mouse.
I think it works fine when using a mouse with a scroll wheel.
The two last scrolls up were very small scrolls and the first three scrolled two slides each.

ezgif com-video-to-gif

@VikLiegostaiev VikLiegostaiev changed the title Scroll two sides at once Scroll two slides at once Nov 5, 2019
@VikLiegostaiev
Copy link
Owner

@julianStreibel I understood u incorrectly first time. I've renamed the name of the task. Yes, I'm aware of the problem and hadn't solve it yet.

@jf-t
Copy link

jf-t commented Aug 11, 2020

@VikLiegostaiev The issue is because the scrolling event of a macbook trackpad is over 200 milliseconds, which is what is set as the DEFAULT_ANIMATION_TIMER_BUFFER. I believe there needs to be logic that will stop the default scroll event once the scroll is initiated, so no matter how long it takes the default scroll event to process, it will not jump 2 slides awkwardly.

@floyd-jones
Copy link

Any movement on this? Is there a temporary fix in the mean while?

@guigallo
Copy link

guigallo commented Sep 9, 2021

I'm using this workaround. Blocking scroll up/down onBeforePageScroll and unblocking on pageOnChange.

import { useState } from 'react'
import ReactPageScroller from 'react-page-scroller'

const YouComponent = () => {
  const [blockScroll, setBlockScroll] = useState(false)

  return (
    <ReactPageScroller
      blockScrollUp={blockScroll}
      blockScrollDown={blockScroll}
      onBeforePageScroll={() => setBlockScroll(true)}
      pageOnChange={() => {
        const timeout = setTimeout(() => {
          setBlockScroll(false)
          clearTimeout(timeout)
        }, 750)
      }}
    >
      <Page1 />
      <Page2 />
      <Page3 />
      <Page4 />
    </ReactPageScroller>
  )
}

@Hexi1997
Copy link

Any movement on this? Is there a temporary fix in the mean while?

Repository owner deleted a comment from GloWE3 Mar 4, 2024
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

7 participants