From 305e8b06f0c39b2dac4982d89d6f804964435fa0 Mon Sep 17 00:00:00 2001 From: Serey Roth Date: Fri, 17 May 2024 10:03:49 -0700 Subject: [PATCH] Add check for `DecoratorNode`s for horizontal table navigation. --- 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) ) {