Giter VIP home page Giter VIP logo

Comments (2)

bvaughn avatar bvaughn commented on June 29, 2024 2

Duplicate of #16

Short answer is: Nothing is built it, but you can use the scrollTo API to achieve this.

Here's a Code Sandbox that shows one possible option for this:
https://codesandbox.io/s/k2lpl9m0l3

from react-window.

PascalSenn avatar PascalSenn commented on June 29, 2024

@hizo
the problem you'll face there is that you'll have to render all the items in between.
if you have a list with 10'000 items and you are currently on position 1, you'd have to render all 9000 items if you'd like to jump to index 9000.

You could possibly do a similar effect with css.
If you overrender the list enough and then use transform to animate some kind of flyin effect, you could get a smooth animation.

Thing is. All javascript animations including css animations are processed in the same thread as the "normal" javascript.
Only a few properties can be rendered with hardware acceleration ( GPU not CPU ). Try it with transform or opacity.

Conclusion: if you want to do smooth scrolling, overrender the list and create a keyframe with transform: translateY. That could potentially work.

from react-window.

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.