GithubHelp home page GithubHelp logo

dynamic-virtual-scroll's People

Contributors

vitalif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dynamic-virtual-scroll's Issues

Demo for Vue

If it isnt too much to ask, could you add a sample of how this library is used with Vue.js

Full page mode

Hello,

I'm working on a Vue implementation of your library. (I will open source it later)
It's going pretty well in a container, but i'm trying to achieve the same behaviour in the full page, where the body is the viewport and the scroll event listener is attached to window.

I'm calling virtualScrollDriver like this :

      const bounds = document.querySelector("body").getBoundingClientRect();
      const scrollTop = -bounds.top;
      const viewportHeight = window.innerHeight;
      const newState = virtualScrollDriver(
        {
          totalItems: this.items.length,
          minRowHeight: 100,
          viewportHeight: viewportHeight,
          scrollTop: scrollTop,
        },
        this.scrollerState,
        this.getRenderedItemHeight
      );

It works well, until you have DOM elements in the body, before the list.

For example here, I have a <pre> tag before the list, and it disturbs the virtual scroll behaviour.
image
If you remove the <pre> tag (or change it's position to fixed) it fixes the bug.

You can play with the code here (it can take a while to load) :
https://codesandbox.io/s/flamboyant-easley-ix9pe?file=/src/App.vue

How would you implement the full page mode when the list is not the only item the body ?

Also, not related to the full page mode, before any scroll happen, the lastItems are displayed:
image

Thanks for your help.

lower refresh rate onScroll

Error: Maximum update depth exceeded.   
This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.  
React limits the number of nested updates to prevent infinite loops.

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.