Skip to content

Commit

Permalink
exit formatting with escape
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Oct 21, 2023
1 parent f0df5f4 commit a9b8f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/app/components/editor/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ export function Toolbar() {
<Line variant="SurfaceVariant" direction="Vertical" style={{ height: toRem(12) }} />
<Box shrink="No" gap="100">
<ExitFormatting
tooltip={<BtnTooltip text="Exit Formatting" shortCode={`${modKey} + E`} />}
tooltip={
<BtnTooltip text="Exit Formatting" shortCode={`Escape, ${modKey} + E`} />
}
/>
</Box>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/editor/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
removeAllMark(editor);
return true;
Expand Down

0 comments on commit a9b8f6f

Please sign in to comment.