FormSelectControl: minWidth can be redefined

This commit is contained in:
Enrico Ros
2025-10-18 16:50:17 -07:00
parent 66382ed980
commit 8bef4b9aae
2 changed files with 2 additions and 4 deletions
@@ -144,7 +144,6 @@ export function AppChatSettingsAI() {
options={_tokenCountingMethodOptions}
value={tokenCountingMethod}
onChange={setTokenCountingMethod}
selectSx={{ minWidth: 140 }}
/>
<FormSelectControl
@@ -153,7 +152,6 @@ export function AppChatSettingsAI() {
options={_keepThinkingBlocksOptions}
value={chatKeepLastThinkingOnly ? 'last-only' : 'all'}
onChange={(value) => setChatKeepLastThinkingOnly(value === 'last-only')}
selectSx={{ minWidth: 140 }}
/>
<ListDivider inset='gutter'>Automatic AI Functions</ListDivider>
@@ -35,7 +35,7 @@ export const FormSelectControl = <TValue extends string>(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 = <TValue extends string>(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) => (