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
This commit is contained in:
Alessio Gravili
2025-10-01 09:38:37 -07:00
committed by GitHub
parent 10e5042adb
commit 54b6f15392

View File

@@ -9,6 +9,7 @@ import {
$isRangeSelection, $isRangeSelection,
$setSelection, $setSelection,
COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_LOW,
COMMAND_PRIORITY_NORMAL,
createCommand, createCommand,
KEY_ARROW_DOWN_COMMAND, KEY_ARROW_DOWN_COMMAND,
KEY_ARROW_UP_COMMAND, KEY_ARROW_UP_COMMAND,
@@ -350,7 +351,7 @@ export function LexicalMenu({
} }
return true return true
}, },
COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL,
), ),
editor.registerCommand<KeyboardEvent>( editor.registerCommand<KeyboardEvent>(
KEY_ARROW_UP_COMMAND, KEY_ARROW_UP_COMMAND,
@@ -376,7 +377,7 @@ export function LexicalMenu({
} }
return true return true
}, },
COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL,
), ),
editor.registerCommand<KeyboardEvent>( editor.registerCommand<KeyboardEvent>(
KEY_ESCAPE_COMMAND, KEY_ESCAPE_COMMAND,
@@ -408,7 +409,7 @@ export function LexicalMenu({
selectItemAndCleanUp(selectedItem) selectItemAndCleanUp(selectedItem)
return true return true
}, },
COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL,
), ),
editor.registerCommand( editor.registerCommand(
KEY_ENTER_COMMAND, KEY_ENTER_COMMAND,
@@ -429,7 +430,7 @@ export function LexicalMenu({
selectItemAndCleanUp(selectedItem) selectItemAndCleanUp(selectedItem)
return true return true
}, },
COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL,
), ),
) )
}, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem]) }, [selectItemAndCleanUp, close, editor, groups, selectedItemKey, updateSelectedItem])