Skip to content

Commit 54b6f15

Browse files
authored
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
1 parent 10e5042 commit 54b6f15

File tree

1 file changed

+5
-4
lines changed
  • packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin

1 file changed

+5
-4
lines changed

packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
$isRangeSelection,
1010
$setSelection,
1111
COMMAND_PRIORITY_LOW,
12+
COMMAND_PRIORITY_NORMAL,
1213
createCommand,
1314
KEY_ARROW_DOWN_COMMAND,
1415
KEY_ARROW_UP_COMMAND,
@@ -350,7 +351,7 @@ export function LexicalMenu({
350351
}
351352
return true
352353
},
353-
COMMAND_PRIORITY_LOW,
354+
COMMAND_PRIORITY_NORMAL,
354355
),
355356
editor.registerCommand<KeyboardEvent>(
356357
KEY_ARROW_UP_COMMAND,
@@ -376,7 +377,7 @@ export function LexicalMenu({
376377
}
377378
return true
378379
},
379-
COMMAND_PRIORITY_LOW,
380+
COMMAND_PRIORITY_NORMAL,
380381
),
381382
editor.registerCommand<KeyboardEvent>(
382383
KEY_ESCAPE_COMMAND,
@@ -408,7 +409,7 @@ export function LexicalMenu({
408409
selectItemAndCleanUp(selectedItem)
409410
return true
410411
},
411-
COMMAND_PRIORITY_LOW,
412+
COMMAND_PRIORITY_NORMAL,
412413
),
413414
editor.registerCommand(
414415
KEY_ENTER_COMMAND,
@@ -429,7 +430,7 @@ export function LexicalMenu({
429430
selectItemAndCleanUp(selectedItem)
430431
return true
431432
},
432-
COMMAND_PRIORITY_LOW,
433+
COMMAND_PRIORITY_NORMAL,
433434
),
434435
)
435436
}, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem])

0 commit comments

Comments
 (0)