try adding a key to force rerender when items load

This commit is contained in:
Mary Hipp 2024-03-13 11:54:40 -04:00 committed by psychedelicious
parent 9d523a3094
commit b64a693f16

View File

@ -18,6 +18,7 @@ const ParamMainModelSelect = () => {
const dispatch = useAppDispatch();
const { t } = useTranslation();
const selectedModel = useAppSelector(selectModel);
console.log({ selectedModel });
const { data, isLoading } = useGetMainModelsQuery(NON_REFINER_BASE_MODELS);
const _onChange = useCallback(
@ -46,7 +47,13 @@ const ParamMainModelSelect = () => {
<InformationalPopover feature="paramModel">
<FormLabel>{t('modelManager.model')}</FormLabel>
</InformationalPopover>
<CustomSelect selectedItem={selectedItem} placeholder={placeholder} items={items} onChange={onChange} />
<CustomSelect
key={items.length}
selectedItem={selectedItem}
placeholder={placeholder}
items={items}
onChange={onChange}
/>
</FormControl>
);
};