From 54b6f1539268352aead91e4882087ac62fab1964 Mon Sep 17 00:00:00 2001 From: Alessio Gravili Date: Wed, 1 Oct 2025 09:38:37 -0700 Subject: [PATCH] fix(richtext-lexical): slash menu arrows keys not respected when block nearby (#14015) This PR fixes an issue where the Decorator plugin intercepted arrow keys, preventing navigation while the slash menu was open. By increasing the command priority of the slash menu plugin, arrow keys now work correctly when the menu is active. ## Before https://github.com/user-attachments/assets/0bffb174-6943-4ef5-9f4a-0d6ea87ce199 ## After https://github.com/user-attachments/assets/99323fb1-dfc7-4b52-8902-efbf7f83ba4d --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1211524241290880 --- .../SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx index bb7437776..944c437a1 100644 --- a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx +++ b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx @@ -9,6 +9,7 @@ import { $isRangeSelection, $setSelection, COMMAND_PRIORITY_LOW, + COMMAND_PRIORITY_NORMAL, createCommand, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, @@ -350,7 +351,7 @@ export function LexicalMenu({ } return true }, - COMMAND_PRIORITY_LOW, + COMMAND_PRIORITY_NORMAL, ), editor.registerCommand( KEY_ARROW_UP_COMMAND, @@ -376,7 +377,7 @@ export function LexicalMenu({ } return true }, - COMMAND_PRIORITY_LOW, + COMMAND_PRIORITY_NORMAL, ), editor.registerCommand( KEY_ESCAPE_COMMAND, @@ -408,7 +409,7 @@ export function LexicalMenu({ selectItemAndCleanUp(selectedItem) return true }, - COMMAND_PRIORITY_LOW, + COMMAND_PRIORITY_NORMAL, ), editor.registerCommand( KEY_ENTER_COMMAND, @@ -429,7 +430,7 @@ export function LexicalMenu({ selectItemAndCleanUp(selectedItem) return true }, - COMMAND_PRIORITY_LOW, + COMMAND_PRIORITY_NORMAL, ), ) }, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem])