mirror of
https://github.com/usememos/memos.git
synced 2025-02-19 04:40:40 +01:00
feat: esc to cancel editing (#532)
This commit is contained in:
parent
7c78fb064f
commit
5e069f79a2
@ -99,8 +99,12 @@ const MemoEditor = () => {
|
||||
}, [editorState.editMemoId]);
|
||||
|
||||
const handleKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === "Escape" && state.fullscreen) {
|
||||
handleFullscreenBtnClick();
|
||||
if (event.key === "Escape") {
|
||||
if (state.fullscreen) {
|
||||
handleFullscreenBtnClick();
|
||||
} else {
|
||||
handleCancelEdit();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (event.key === "Tab") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user