mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +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) => {
|
const onSeek = (offset) => {
|
||||||
if (player.current) {
|
if (player.current) {
|
||||||
let len = player.current.getDuration();
|
let len = player.current.getDuration();
|
||||||
|
if (len > 128) {
|
||||||
|
offset *= Math.floor(len / 128);
|
||||||
|
}
|
||||||
seek.current += offset;
|
seek.current += offset;
|
||||||
if (seek.current < 0 || seek.current >= len) {
|
if (seek.current < 0 || seek.current >= len) {
|
||||||
seek.current = 0;
|
seek.current = 0;
|
||||||
|
@ -316,6 +316,7 @@ export function VirtualList({ id, items, itemRenderer }) {
|
|||||||
if (height) {
|
if (height) {
|
||||||
growCanvasHeight(height * 3);
|
growCanvasHeight(height * 3);
|
||||||
viewHeight.current = height;
|
viewHeight.current = height;
|
||||||
|
updateCanvas();
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<VirtualListWrapper onScroll={onScrollView} onWheel={onScrollWheel}>
|
<VirtualListWrapper onScroll={onScrollView} onWheel={onScrollWheel}>
|
||||||
|
Loading…
Reference in New Issue
Block a user