Skip to content

Commit cc30905

Browse files
🐛 fix: Fix HotkeyInput reset on record
1 parent 621932d commit cc30905

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Hotkey/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ const mappingKey = (isAppleDevice: boolean) => ({
6464
[KeyMapEnum.Up]: <Icon icon={ArrowUpIcon} />,
6565
[KeyMapEnum.Comma]: ',',
6666
[KeyMapEnum.Period]: '.',
67-
[KeyMapEnum.Slash]: '/',
67+
[KeyMapEnum.Slash]: '?',
6868
[KeyMapEnum.Semicolon]: ';',
6969
[KeyMapEnum.Quote]: "'",
7070
[KeyMapEnum.Backquote]: '`',
7171
[KeyMapEnum.Backslash]: '\\',
7272
[KeyMapEnum.BracketLeft]: '[',
7373
[KeyMapEnum.BracketRight]: ']',
7474
[KeyMapEnum.Minus]: '-',
75-
[KeyMapEnum.Equal]: '=',
75+
[KeyMapEnum.Equal]: '+',
7676
});
7777

7878
export interface HotkeyProps extends Omit<FlexboxProps, 'children'> {

src/Hotkey/type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const KeyMapEnum = {
1919
Minus: 'minus', // -
2020
Mod: 'mod', // Command on Mac, Ctrl on Win
2121
Period: 'period', // .
22+
Plus: 'equal', // +
23+
QuestionMark: 'slash', // ?
2224
Quote: 'quote', // '
2325
Right: 'right',
2426
RightClick: 'right-click',

src/HotkeyInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ const HotkeyInput = memo<HotkeyInputProps>(
271271
style={{ pointerEvents: 'none' }}
272272
/>
273273

274-
{allowReset && hotkeyValue && hotkeyValue !== resetValue && !disabled && (
274+
{!isFocused && allowReset && hotkeyValue && hotkeyValue !== resetValue && !disabled && (
275275
<ActionIcon
276276
active
277277
icon={Undo2Icon}

0 commit comments

Comments
 (0)