From 6bed93f4c8156ae4d60d8b900c9927fae905b2c9 Mon Sep 17 00:00:00 2001 From: Jeremy Llewellyn Date: Thu, 9 May 2024 10:44:45 -0700 Subject: [PATCH] Fix scrolling by pixels --- packages/core/src/data-editor/data-editor.tsx | 4 ++-- .../src/docs/examples/imperative-scroll.stories.tsx | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/core/src/data-editor/data-editor.tsx b/packages/core/src/data-editor/data-editor.tsx index 7a3c89d86..55b3f5e05 100644 --- a/packages/core/src/data-editor/data-editor.tsx +++ b/packages/core/src/data-editor/data-editor.tsx @@ -1496,8 +1496,8 @@ const DataEditorImpl: React.ForwardRefRenderFunction = p => { }); }; + const pixels = 1_000_000_000; + const onClickEnd = () => { + ref.current?.scrollTo({ + amount: pixels, + unit: "px", + }, + 0, + "horizontal"); + }; + return ( = p => { Click to scroll to column 4 row 100 + + Click to scroll by {pixels} pixels + }>