fix(ui): useModelCombobox should use null for no value instead of undefined

This fixes an issue where the refiner combobox doesn't clear itself visually when clicking the little X icon to clear the selection.
This commit is contained in:
psychedelicious
2025-04-09 15:41:08 +10:00
parent 9cc13556aa
commit 72173e284c

View File

@@ -38,7 +38,7 @@ export const useModelCombobox = <T extends AnyModelConfig>(arg: UseModelCombobox
}, [optionsFilter, getIsDisabled, modelConfigs, shouldShowModelDescriptions]);
const value = useMemo(
() => options.find((m) => (selectedModel ? m.value === selectedModel.key : false)),
() => options.find((m) => (selectedModel ? m.value === selectedModel.key : false)) ?? null,
[options, selectedModel]
);