A direct port of react-infinite-list to Ember. This was created as a benchmark exercise.
This component will only ever render DOM nodes for what can fill the view port. Using the power of Glimmer, it will reuse the DOM nodes it's already created and swap out the content as the user scrolls.
If you want a more flexible virtualization component, please try ember-collection.
ember install virtual-each
height
: fixed height of the component (required)itemHeight
: fixed row height (required)onScrollBottomed
: invoked when scrolled to the bottom of the list (optional)positionIndex
: start at or scroll to a specific item based on the item index (optional)
Add the following CSS snippet to styles/app.css
:
.virtual-each {
overflow-y: auto;
}
.infinite-list-content {
list-style: none;
margin: 0;
padding: 0;
}
- Not defining an
itemHeight
, or defining a less-than expected height, will result in unexpected jumping behavior during scrolling.itemHeight
should be set to exact height of a row.
- Ember >= 2.12.0
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server