Comments (15)
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.
Also fixed by overriding with !important
on the container.
from react-indiana-drag-scroll.
@maxwellfortney do you want to preserve scroll by mouse wheel along with scroll by mouse drag?
from react-indiana-drag-scroll.
@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.
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.
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.
@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.
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.
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.
@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.
@maxwellfortney, according to your code above you don't mind if scrollbars appear?
from react-indiana-drag-scroll.
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.
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.
@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.
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.
@maxwellfortney I would appreciate it. And, of course, there's no rush.
from react-indiana-drag-scroll.
Related Issues (20)
- [Request] Be able to change cursor HOT 4
- Testing issues HOT 5
- [Request] Option to remove body class HOT 9
- No way to get scroll offsets HOT 3
- There is no response to the components in ScrollContainer. HOT 8
- Doesn't work with scroll snapping HOT 3
- Any plan of migrating to function components? HOT 4
- Any plan to support React 18? HOT 5
- Activate drag scroll with the mouse wheel? HOT 5
- Change input in container HOT 4
- Horizontal scroll not working with touchpad HOT 7
- 'ScrollContainer' cannot be used as a JSX component. HOT 6
- style prop isn't applied in v3 HOT 10
- Dragging problem on touch devices HOT 8
- Add horizontal scroll support using a scroll wheel HOT 2
- reset scroll bar position HOT 1
- scrollLeft not set when scrolling with mousewheel HOT 3
- Receiving [Violation] warning on every render of ScrollContainer
- Bad importation at https://norserium.github.io/react-indiana-drag-scroll/ HOT 1
- v3 feedback HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-indiana-drag-scroll.