fix(ui): autocomplete options for metadata
This commit is contained in:
parent
6cbe9632c9
commit
9612fa2024
2 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 !== '');
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue