Skip to content

Commit 904f6e5

Browse files
committed
fix: disable navigation hotkeys when editing, close #80
1 parent 5c48f70 commit 904f6e5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

components/hotkey-tooltip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const HotkeyTooltip: FC<{
2525
optionKey?: boolean
2626
onClose?: TooltipProps['onClose']
2727
onHotkey?: () => void
28+
disableOnContentEditable?: boolean
2829
}> = ({
2930
text,
3031
keys = [],
@@ -33,6 +34,7 @@ const HotkeyTooltip: FC<{
3334
commandKey,
3435
optionKey,
3536
onHotkey = noop,
37+
disableOnContentEditable = false,
3638
}) => {
3739
const {
3840
ua: { isMac },
@@ -56,7 +58,7 @@ const HotkeyTooltip: FC<{
5658
{
5759
enabled: !!keys.length,
5860
enableOnTags: ['INPUT', 'TEXTAREA'],
59-
enableOnContentEditable: true,
61+
enableOnContentEditable: !disableOnContentEditable,
6062
},
6163
[onHotkey]
6264
)

components/nav-button-group.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const NavButtonGroup: FC = () => {
7171
onHotkey={back}
7272
keys={['Left']}
7373
commandKey
74+
disableOnContentEditable
7475
>
7576
<IconButton disabled={!canBack} icon="ArrowSmLeft" onClick={back} />
7677
</HotkeyTooltip>
@@ -79,6 +80,7 @@ const NavButtonGroup: FC = () => {
7980
onHotkey={forward}
8081
keys={['Right']}
8182
commandKey
83+
disableOnContentEditable
8284
>
8385
<IconButton
8486
disabled={!canForward}

0 commit comments

Comments
 (0)