mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
fix: fixes wrong selection in model config dropdown (#80)
This commit is contained in:
parent
6ca163fc8c
commit
2e37c89310
1 changed files with 7 additions and 2 deletions
|
|
@ -110,9 +110,11 @@ export default function ServiceConfiguration() {
|
|||
setServicePropertyValues("tts");
|
||||
setServicePropertyValues("stt");
|
||||
|
||||
setServiceProviders(selectedProviders);
|
||||
|
||||
// IMPORTANT: Reset form values BEFORE changing providers
|
||||
// Otherwise, Radix Select sees old values that don't match new provider's enum
|
||||
// and calls onValueChange('') to clear "invalid" values
|
||||
reset(defaultValues);
|
||||
setServiceProviders(selectedProviders);
|
||||
};
|
||||
fetchConfigurations();
|
||||
}, [reset, userConfig]);
|
||||
|
|
@ -294,6 +296,9 @@ export default function ServiceConfiguration() {
|
|||
<Select
|
||||
value={watch(`${service}_${field}`) as string || ""}
|
||||
onValueChange={(value) => {
|
||||
// Ignore empty string - Radix Select sometimes calls onValueChange('')
|
||||
// when options change, even if current value is valid
|
||||
if (!value) return;
|
||||
setValue(`${service}_${field}`, value, { shouldDirty: true });
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue