mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
update virtual list on browser resize
This commit is contained in:
parent
b39f24d9a7
commit
55b96bcfcf
@ -18,6 +18,9 @@ export function VideoFile({ url, onPosition }) {
|
||||
const onSeek = (offset) => {
|
||||
if (player.current) {
|
||||
let len = player.current.getDuration();
|
||||
if (len > 128) {
|
||||
offset *= Math.floor(len / 128);
|
||||
}
|
||||
seek.current += offset;
|
||||
if (seek.current < 0 || seek.current >= len) {
|
||||
seek.current = 0;
|
||||
|
@ -316,6 +316,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
||||
if (height) {
|
||||
growCanvasHeight(height * 3);
|
||||
viewHeight.current = height;
|
||||
updateCanvas();
|
||||
}
|
||||
return (
|
||||
<VirtualListWrapper onScroll={onScrollView} onWheel={onScrollWheel}>
|
||||
|
Loading…
Reference in New Issue
Block a user