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:
@@ -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<KeyboardEvent>(
|
||||
KEY_ARROW_UP_COMMAND,
|
||||
@@ -376,7 +377,7 @@ export function LexicalMenu({
|
||||
}
|
||||
return true
|
||||
},
|
||||
COMMAND_PRIORITY_LOW,
|
||||
COMMAND_PRIORITY_NORMAL,
|
||||
),
|
||||
editor.registerCommand<KeyboardEvent>(
|
||||
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])
|
||||
|
||||
Reference in New Issue
Block a user