From 0842bf3c81c88d154510cd46d0b57d16570c8ec3 Mon Sep 17 00:00:00 2001 From: zbeyens Date: Mon, 21 Oct 2024 14:59:55 +0200 Subject: [PATCH] fix --- .changeset/sweet-sloths-cough.md | 5 +++++ packages/selection/src/react/BlockSelectionPlugin.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/sweet-sloths-cough.md diff --git a/.changeset/sweet-sloths-cough.md b/.changeset/sweet-sloths-cough.md new file mode 100644 index 0000000000..2f989e2cbd --- /dev/null +++ b/.changeset/sweet-sloths-cough.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-selection': patch +--- + +Fix: prevent scroll on block selection diff --git a/packages/selection/src/react/BlockSelectionPlugin.tsx b/packages/selection/src/react/BlockSelectionPlugin.tsx index 624b3df9dd..cb54d5d9a8 100644 --- a/packages/selection/src/react/BlockSelectionPlugin.tsx +++ b/packages/selection/src/react/BlockSelectionPlugin.tsx @@ -110,7 +110,7 @@ export const BlockSelectionAfterEditable: EditableSiblingComponent = () => { React.useEffect(() => { if (isSelecting && inputRef.current) { - inputRef.current.focus(); + inputRef.current.focus({ preventScroll: true }); } else if (inputRef.current) { inputRef.current.blur(); }