mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Fix editor focus after autocomplete (#2233)
* upgrade slatejs * collapse autocomplete on escape * make FN_KEYS_REGEX const in module scope
This commit is contained in:
parent
2c7038cd1f
commit
ccfe30cd68
4 changed files with 84 additions and 49 deletions
|
|
@ -353,10 +353,14 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
|||
}
|
||||
if (isKeyHotkey('escape', evt)) {
|
||||
evt.preventDefault();
|
||||
if (autocompleteQuery) {
|
||||
setAutocompleteQuery(undefined);
|
||||
return;
|
||||
}
|
||||
setReplyDraft(undefined);
|
||||
}
|
||||
},
|
||||
[submit, setReplyDraft, enterForNewline]
|
||||
[submit, setReplyDraft, enterForNewline, autocompleteQuery]
|
||||
);
|
||||
|
||||
const handleKeyUp: KeyboardEventHandler = useCallback(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue