From 7802cbf23f37de801b79bcdc7361d35fd615dcbe Mon Sep 17 00:00:00 2001 From: "wellssu0@gmail.com" Date: Tue, 21 Jun 2022 12:11:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(example/virtual-list-grid):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=BD=93=E4=BF=AE=E6=94=B9table=E7=9A=84dataSource?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=8B=BF=E5=88=B0scrollBod?= =?UTF-8?q?yRef.scrollLeft=E8=80=8C=E5=AF=BC=E8=87=B4=E7=9A=84header?= =?UTF-8?q?=E7=9A=84=E6=BB=9A=E5=8A=A8=E4=BD=8D=E7=BD=AE=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/examples/virtual-list-grid.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 });