From ad02ba600e5c14126a30488ea5608189280daef5 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Sun, 29 May 2022 16:39:34 +0800 Subject: [PATCH] chore: enhance input field styles --- src/components/settings/SidebarSettings.tsx | 4 ++-- src/styles/index.scss | 10 ---------- src/utils/general.ts | 3 +++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/components/settings/SidebarSettings.tsx b/src/components/settings/SidebarSettings.tsx index 20c8335..f46422c 100644 --- a/src/components/settings/SidebarSettings.tsx +++ b/src/components/settings/SidebarSettings.tsx @@ -2,7 +2,7 @@ import { Button, TextInput } from '@primer/react' import { SimpleToggleField } from 'components/SimpleToggleField' import { useConfigs } from 'containers/ConfigsContext' import * as React from 'react' -import { friendlyFormatShortcut } from 'utils/general' +import { friendlyFormatShortcut, noop } from 'utils/general' import { useStateIO } from 'utils/hooks/useStateIO' import * as keyHelper from 'utils/keyHelper' import { Field } from './Field' @@ -30,6 +30,7 @@ export function SidebarSettings() { onBlur={() => focused.onChange(false)} placeholder={focused.value ? 'Press key combination' : 'Click here to set'} value={friendlyFormatShortcut(toggleShowSideBarShortcut)} + onChange={noop} onKeyDown={React.useCallback((e: React.KeyboardEvent) => { e.preventDefault() e.stopPropagation() @@ -37,7 +38,6 @@ export function SidebarSettings() { const shortcut = e.key === 'Backspace' ? '' : keyHelper.parseEvent(e) useToggleShowSideBarShortcut.onChange(shortcut) }, [])} // eslint-disable-line react-hooks/exhaustive-deps - readOnly /> {configContext.value.shortcut === toggleShowSideBarShortcut ? (