From 8bef4b9aae47f2fcf67b74e19195e05907e100de Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Sat, 18 Oct 2025 16:50:17 -0700 Subject: [PATCH] FormSelectControl: minWidth can be redefined --- src/apps/settings-modal/AppChatSettingsAI.tsx | 2 -- src/common/components/forms/FormSelectControl.tsx | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/apps/settings-modal/AppChatSettingsAI.tsx b/src/apps/settings-modal/AppChatSettingsAI.tsx index 4d6b36158..9caea32cf 100644 --- a/src/apps/settings-modal/AppChatSettingsAI.tsx +++ b/src/apps/settings-modal/AppChatSettingsAI.tsx @@ -144,7 +144,6 @@ export function AppChatSettingsAI() { options={_tokenCountingMethodOptions} value={tokenCountingMethod} onChange={setTokenCountingMethod} - selectSx={{ minWidth: 140 }} /> setChatKeepLastThinkingOnly(value === 'last-only')} - selectSx={{ minWidth: 140 }} /> Automatic AI Functions diff --git a/src/common/components/forms/FormSelectControl.tsx b/src/common/components/forms/FormSelectControl.tsx index 0cfda0a23..267fa49d0 100644 --- a/src/common/components/forms/FormSelectControl.tsx +++ b/src/common/components/forms/FormSelectControl.tsx @@ -35,7 +35,7 @@ export const FormSelectControl = (props: { value?: TValue; onChange: (value: TValue) => void; placeholder?: React.ReactNode; - selectSx?: SxProps; + selectSx?: SxProps; // overrides the minimum button width, if 'maxWidth' is set }) => { const selectedOption = props.options.find(option => option.value === props.value); @@ -53,7 +53,7 @@ export const FormSelectControl = (props: { value={props.value} onChange={(_, value) => value && props.onChange(value as TValue)} placeholder={props.placeholder} - slotProps={_selectSlotProps} + slotProps={!(props.selectSx as any)?.['minWidth'] ? _selectSlotProps : undefined} sx={props.selectSx} > {props.options.map((option, idx) => (