exit formatting with escape

This commit is contained in:
Ajay Bura 2023-10-21 12:15:02 +05:30
parent f0df5f4ac8
commit a9b8f6f4d5
2 changed files with 4 additions and 2 deletions
src/app/components/editor

View file

@ -285,7 +285,9 @@ export function Toolbar() {
<Line variant="SurfaceVariant" direction="Vertical" style={{ height: toRem(12) }} /> <Line variant="SurfaceVariant" direction="Vertical" style={{ height: toRem(12) }} />
<Box shrink="No" gap="100"> <Box shrink="No" gap="100">
<ExitFormatting <ExitFormatting
tooltip={<BtnTooltip text="Exit Formatting" shortCode={`${modKey} + E`} />} tooltip={
<BtnTooltip text="Exit Formatting" shortCode={`Escape, ${modKey} + E`} />
}
/> />
</Box> </Box>
</> </>

View file

@ -55,7 +55,7 @@ export const toggleKeyboardShortcut = (editor: Editor, event: KeyboardEvent<Elem
} }
} }
if (isKeyHotkey('mod+e', event)) { if (isKeyHotkey('mod+e', event) || isKeyHotkey('escape', event)) {
if (isAnyMarkActive(editor)) { if (isAnyMarkActive(editor)) {
removeAllMark(editor); removeAllMark(editor);
return true; return true;