react-virtualized icon indicating copy to clipboard operation
react-virtualized copied to clipboard

Large lists are scrolled too fast

Open d07RiV opened this issue 8 years ago • 10 comments

If I make a very large list (a million lines), it becomes extremely sensitive to scrolling. Mouse wheel scrolls for ~60 lines per tick, and page up/down key goes through 500+ lines.

Here's a simple demo: https://codesandbox.io/s/zl3yomvlqm

d07RiV avatar Dec 30 '17 14:12 d07RiV

@d07RiV It's artificial scroll virtualization. Browsers has constraints for element size. So virtualized is trying to scale scroll and fit it to 1_500_000 pixels.

TrySound avatar Dec 30 '17 14:12 TrySound

FWIW, I mentioned this particular feature of RV in a set of presentation slides. (Maybe the visualization will be useful.)

Currently, RV compresses for IE (the lowest common denominator) which has a limit of 1.5 million pixels. I've thought in the past about trying to maintain a built-in map of browser-to-max-size though, so we don't have to scale so early for eg Firefox and Chrome. Unfortunately I don't think there's a way to query the browser for this sort of info, so it would have to be hard-coded. I'd be happy to review a PR that adds this, provided it doesn't add a ton of complexity or runtime cost.

bvaughn avatar Dec 30 '17 17:12 bvaughn

Yes, I noticed that it is due to scroll area being limited to 1.5M pixels, but isn't it possible to artificially slow down scrolling? It makes no sense when PageDown scrolls 10 pages at a time.

Also, browsers don't seem to have an issue displaying gigantic plain files (other than doing it very slowly), but I guess the limitation doesn't apply there?

d07RiV avatar Dec 30 '17 20:12 d07RiV

@d07RiV From slides

Chrome 33.5M px, IE 1.5M px

Are you sure they are so big?

TrySound avatar Dec 30 '17 20:12 TrySound

@bvaughn Is there a video with that talk?

TrySound avatar Dec 30 '17 20:12 TrySound

Yes, I noticed that it is due to scroll area being limited to 1.5M pixels, but isn't it possible to artificially slow down scrolling? It makes no sense when PageDown scrolls 10 pages at a time.

Nope. Not with the way RV is implemented, and not without breaking momentum scrolling.

If I ever find the time to finish PR #515 this would become a non-issue.

Also, browsers don't seem to have an issue displaying gigantic plain files (other than doing it very slowly), but I guess the limitation doesn't apply there?

Show me a "gigantic plain file" with a DOM element that's > 1,500,000 pixels wide or tall. 😄 Even so, it would work okay it Chrome and Firefox, but not in Internet Explorer.

Chrome 33.5M px, IE 1.5M px

Are you sure they are so big?

Yes 😄

Is there a video with that talk?

Yup https://www.youtube.com/watch?v=t4tuhg7b50I

bvaughn avatar Dec 30 '17 21:12 bvaughn

Show me a "gigantic plain file" with a DOM element that's > 1,500,000 pixels wide or tall. 😄 Even so, it would work okay it Chrome and Firefox, but not in Internet Explorer.

Chrome renders plain files into a gigantic PRE. Not quite enough to break the supposed 33.5M px, though, maybe I should try with an even bigger file.

image

Edge stops rendering at around 5.5M pixels, though, so guess plain files are also an issue :|

Anyway, thanks, I'll have to deal with unnatural scrolling I guess.

d07RiV avatar Dec 31 '17 01:12 d07RiV

Anyway, thanks, I'll have to deal with unnatural scrolling I guess.

Or you could submit a PR like I mentioned above. :wink:

bvaughn avatar Dec 31 '17 03:12 bvaughn

#936 improves this for Chrome and will be released shortly as 9.17

If you'd like to contribute a PR that improves this for Safari and Firefox, etc. please do!

bvaughn avatar Jan 13 '18 22:01 bvaughn

Hello, I am displaying large lists over 20, 000 items using react-virtualized. The problem is that scrolling is moving too fast on Firefox. But it works well on Chrome. Is there any solution to fix this issue on Firefox?

intel0725 avatar Nov 11 '24 16:11 intel0725