Fix hotkeys breaking newline handling
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
5161b3cba9
commit
eedd894ba8
1 changed files with 69 additions and 65 deletions
|
@ -474,7 +474,10 @@ const AutosuggestPlugin = ({
|
||||||
}
|
}
|
||||||
}, [resolution, suggestionsHidden, suggestions.isEmpty()]);
|
}, [resolution, suggestionsHidden, suggestions.isEmpty()]);
|
||||||
|
|
||||||
useEffect(() => mergeRegister(
|
useEffect(() => {
|
||||||
|
if (resolution === null) return;
|
||||||
|
|
||||||
|
return mergeRegister(
|
||||||
editor.registerCommand<KeyboardEvent>(
|
editor.registerCommand<KeyboardEvent>(
|
||||||
KEY_ARROW_UP_COMMAND,
|
KEY_ARROW_UP_COMMAND,
|
||||||
(payload) => {
|
(payload) => {
|
||||||
|
@ -542,7 +545,8 @@ const AutosuggestPlugin = ({
|
||||||
},
|
},
|
||||||
COMMAND_PRIORITY_LOW,
|
COMMAND_PRIORITY_LOW,
|
||||||
),
|
),
|
||||||
), [editor, selectedSuggestion]);
|
);
|
||||||
|
}, [editor, selectedSuggestion, resolution]);
|
||||||
|
|
||||||
return resolution === null || editor === null ? null : (
|
return resolution === null || editor === null ? null : (
|
||||||
<LexicalPopoverMenu
|
<LexicalPopoverMenu
|
||||||
|
|
Loading…
Reference in a new issue