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

Horizontal Scroll even after Disable X-Axis Scrolling #481

Open
idiotWu opened this issue Jun 3, 2022 Discussed in #480 · 3 comments
Open

Horizontal Scroll even after Disable X-Axis Scrolling #481

idiotWu opened this issue Jun 3, 2022 Discussed in #480 · 3 comments
Assignees
Projects
Milestone

Comments

@idiotWu
Copy link
Owner

idiotWu commented Jun 3, 2022

Discussed in #480

Originally posted by blitzve0 June 4, 2022

demo.mp4

Hi, I am using a plugin to disable X-axis horizontal scrolling totally, but sometimes accidentally when I hold and drag from the right edge, the site starts horizontally dragging. You can check the video and can try it out also here https://haspr.in/

This is the Plugin

import Scrollbar from 'smooth-scrollbar'

class DisableScroll extends Scrollbar.ScrollbarPlugin {
  static pluginName = 'DisableScroll'

  transformDelta(delta, fromEvent) {
    delta['x'] = 0

    return delta
  }
}

DisableScroll.pluginName = 'DisableScroll'
export default DisableScroll

```</div>
@idiotWu idiotWu added the bug label Jun 3, 2022
@idiotWu idiotWu added this to the v9 milestone Jun 3, 2022
@idiotWu idiotWu self-assigned this Jun 3, 2022
@idiotWu idiotWu added this to TODO in v9 Jun 3, 2022
@idiotWu idiotWu moved this from TODO to Bugs in v9 Jun 3, 2022
@RubenReuring
Copy link

Got the same issue here. Any idea how to quick fix or when an update will be comming?

@idiotWu
Copy link
Owner Author

idiotWu commented Aug 5, 2022

@RubenReuring a quick and dirty fix that eliminates horizontal scrolling:

import { Scrollbar } from 'smooth-scrollbar/scrollbar'; // NOTICE: not the default entry

const setMomentum = Scrollbar.prototype.setMomentum;

Scrollbar.prototype.setMomentum = function(x, y) {
    setMomentum.call(this, 0, y);
}

@sadeghbarati
Copy link
Collaborator

sadeghbarati commented Jan 12, 2023

#511 (comment)

Temporary workaround

scrollbar.limit.x = 0

https://stackblitz.com/~/github.com/Cuberto/scroll-sequence-demo

once all dependencies installed open terminal ctrl + `

and run gulp command to start the server

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

No branches or pull requests

3 participants