Fixed filter menu issue.

This commit is contained in:
Mike Cao 2024-03-28 10:04:01 -07:00
parent 538fb49219
commit 6ea48d5c2c

View File

@ -105,9 +105,9 @@ export default function FieldFilterEditForm({
onChange({ name, type, operator, value: isEquals ? selected : value }); onChange({ name, type, operator, value: isEquals ? selected : value });
}; };
const handleMenuSelect = (close: () => void, value: string) => { const handleMenuSelect = (value: string) => {
setSelected(value); setSelected(value);
close(); setShowMenu(false);
}; };
const handleSearch = (value: string) => { const handleSearch = (value: string) => {
@ -177,7 +177,7 @@ export default function FieldFilterEditForm({
values={filteredValues} values={filteredValues}
type={name} type={name}
isLoading={isLoading} isLoading={isLoading}
onSelect={handleMenuSelect.bind(null, close)} onSelect={handleMenuSelect}
/> />
)} )}
</div> </div>
@ -202,7 +202,7 @@ const ResultsMenu = ({ values, type, isLoading, onSelect }) => {
const { formatValue } = useFormat(); const { formatValue } = useFormat();
if (isLoading) { if (isLoading) {
return ( return (
<Menu> <Menu className={styles.menu} variant="popup">
<Item> <Item>
<Loading icon="dots" position="center" /> <Loading icon="dots" position="center" />
</Item> </Item>
@ -216,7 +216,7 @@ const ResultsMenu = ({ values, type, isLoading, onSelect }) => {
return ( return (
<Menu className={styles.menu} variant="popup" onSelect={onSelect}> <Menu className={styles.menu} variant="popup" onSelect={onSelect}>
{values?.map(value => { {values?.map((value: any) => {
return <Item key={value}>{formatValue(value, type)}</Item>; return <Item key={value}>{formatValue(value, type)}</Item>;
})} })}
</Menu> </Menu>