fix(ui): autocomplete options for metadata

This commit is contained in:
Shekar Siri 2025-04-23 12:26:11 +02:00
parent 6cbe9632c9
commit 9612fa2024
2 changed files with 4 additions and 0 deletions

View file

@ -194,6 +194,9 @@ const FilterAutoComplete: React.FC<Props> = ({
const data = await searchService.fetchAutoCompleteValues({ ..._params, q: inputValue });
const _options = data.map((i: any) => ({ value: i.value, label: i.value })) || [];
setOptions(_options);
if (inputRef.current === document.activeElement) {
setMenuIsOpen(true);
}
callback(_options);
} catch (e) {
throw new Error(e);

View file

@ -20,6 +20,7 @@ export default class FilterStore {
}
setTopValues = (key: string, values: TopValue[]) => {
if(!Array.isArray(values)) return;
this.topValues[key] = values?.filter((value) => value !== null && value.value !== '');
};