From 94f8614b898538c68d081ead2e2c6e20b5d4172b Mon Sep 17 00:00:00 2001 From: Serey Roth <88986106+serey-roth@users.noreply.github.com> Date: Sun, 19 May 2024 11:24:06 -0700 Subject: [PATCH] Bug Fix: Add check for `DecoratorNode` for horizontal table navigation. (#6129) --- packages/lexical-table/src/LexicalTableSelectionHelpers.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts index 400d88fdde6..7d89e3fb961 100644 --- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts +++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts @@ -32,6 +32,7 @@ import { $getNearestNodeFromDOMNode, $getPreviousSelection, $getSelection, + $isDecoratorNode, $isElementNode, $isRangeSelection, $isTextNode, @@ -1359,6 +1360,11 @@ function $handleArrowKey( return false; } + const selectedNodes = selection.getNodes(); + if (selectedNodes.length === 1 && $isDecoratorNode(selectedNodes[0])) { + return false; + } + if ( isExitingTableAnchor(anchorType, anchorOffset, anchorNode, direction) ) {