Fix scroll position preservation with header

master v1.0.5
Vitaliy Filippov 2019-04-22 19:59:39 +03:00
parent dc00c10f96
commit 68693f3312
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ export class VirtualScrollList extends React.Component
const el = this.viewport.querySelector('div[data-item="'+Math.floor(pos)+'"]');
if (el)
{
this.viewport.scrollTop = el.offsetTop + el.offsetHeight*(pos-Math.floor(pos));
this.viewport.scrollTop = el.offsetTop - (this.props.headerHeight||0) + el.offsetHeight*(pos-Math.floor(pos));
}
this.setState({ scrollTimes: 0 });
}

View File

@ -1,6 +1,6 @@
{
"name": "dynamic-virtual-scroll",
"version": "1.0.4",
"version": "1.0.5",
"author": {
"name": "Vitaliy Filippov",
"email": "vitalif@yourcmc.ru",