Code Monkey home page Code Monkey logo

Comments (15)

maxwellfortney avatar maxwellfortney commented on May 25, 2024 1

Can confirm the overflow properties are conflicting and preventing the scroll with a wheel. By unchecking overflow: hidden the scroll function with the mouse wheel is returned.

image

Also fixed by overriding with !important on the container.

image

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024 1

@maxwellfortney do you want to preserve scroll by mouse wheel along with scroll by mouse drag?

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024 1

@nemosmithasf, this issue is resolved in 3.x.x. Feel free to try it now:

npm install react-indiana-drag-scroll@next

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024

Hello, @nemosmithasf!

It's the good question. I'm not sure, what's the behavior should be for a wheel (a touchpad should work well, but I receive the reports, that sometime it doesn't).

You are able to scroll by a wheel only vertically, so it can be perceived as an oddly behavior.

from react-indiana-drag-scroll.

nemosmithasf avatar nemosmithasf commented on May 25, 2024

I've tried scrolling using the horizontal scroll wheel on an MX Master 2, and it didn't work.
I also tried using the MacBook Pro trackpad for horizontal scrolling, which also didn't work.

Interestingly, if I turn off hideScrollBars, then the horizontal functionality returns. I was also able to hide the bar using the -webkit-scrollbar styling detailed above

from react-indiana-drag-scroll.

sntk avatar sntk commented on May 25, 2024

@nemosmithasf When you set hideScrollBars to true, the container must have overflow: auto;. If you inspect the element, you'll notice indiana-scroll-container--hide-scrollbars class is added with overflow: hidden.

Hope this helps! :)

from react-indiana-drag-scroll.

YLeventhal avatar YLeventhal commented on May 25, 2024

just adding to @sntk 's post, if you change the overflow:hidden => overflow: auto or scroll, you will have scroll ability and the scroll bars will still be hidden because of the styling you have placed on them.
FYI a lot of those rules ie.
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar

are not standard as per MDN and are advised against using.

Other than that, nice job.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024

Hello, @YLeventhal!

are not standard as per MDN and are advised against using.

Do you have any other idea how to hide scrollbars and preserve native mobile scroll?

from react-indiana-drag-scroll.

maxwellfortney avatar maxwellfortney commented on May 25, 2024

@Norserium For my use case yes, I needed the mouse wheel as well as the mouse drag to work. Adding that css allows that. Ideally a toggle like preventWheelScroll would be nice.

Also this is a separate feature request, but I was trying to make it so the div would scroll horizontally without having to hold down shift. But I was unable to get this to work. Not critical, but a nice to have.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024

@maxwellfortney, according to your code above you don't mind if scrollbars appear?

from react-indiana-drag-scroll.

maxwellfortney avatar maxwellfortney commented on May 25, 2024

No, the scrollbars are still hidden with that CSS. The properties are just crossed out because they are added from CSS autoprefixer I assume, and are not being used on chrome.

from react-indiana-drag-scroll.

maxwellfortney avatar maxwellfortney commented on May 25, 2024

To be honest, and I don't mean this in a rude way, but the performance of this package is awful compared to react-scrollbooster. Your package was very choppy for me when using the mouse drag, and was pretty much unusable when I needed to access the onScroll property, react-scrollbooster is quite smooth using both the transform, and native scroll methods.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024

@maxwellfortney, it's okay. But personally I don't feel the perceptible difference (except that scrollbooster has inertia). Could you provide the examples to compare?

from react-indiana-drag-scroll.

maxwellfortney avatar maxwellfortney commented on May 25, 2024

Unfortunately I scrapped the code using this package and didn't commit it, but it was about a 200x4 horizontal grid of emojis characters. I can try to make a comparison demo for you tomorrow.

from react-indiana-drag-scroll.

Norserium avatar Norserium commented on May 25, 2024

@maxwellfortney I would appreciate it. And, of course, there's no rush.

from react-indiana-drag-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.