diff --git a/docs/examples/virtual-list-grid.tsx b/docs/examples/virtual-list-grid.tsx index 2d5ba0c2a..9f24ca738 100644 --- a/docs/examples/virtual-list-grid.tsx +++ b/docs/examples/virtual-list-grid.tsx @@ -27,7 +27,12 @@ const Demo = () => { const [connectObject] = React.useState(() => { const obj = {}; Object.defineProperty(obj, 'scrollLeft', { - get: () => null, + get: () => { + if (gridRef.current) { + return gridRef.current?.state?.scrollLeft; + } + return null; + }, set: (scrollLeft: number) => { if (gridRef.current) { gridRef.current.scrollTo({ scrollLeft });