Fix filter multi select (#8682)
- Created a dropdown inside a dropdown for the `ObjectFilterDropdownOperandDropdown` so the operand can be opened over the selection with an offset - Refactored dropdown component and introduced `DropdownUnmountEffect` to close the dropdown when the component unmounts - Removed old logic Before: <img width="216" alt="Capture d’écran 2024-11-22 à 14 03 58" src="https://github.com/user-attachments/assets/3c1bba03-af03-4993-a070-f009b8dc876f"> After: <img width="222" alt="Capture d’écran 2024-11-22 à 14 03 40" src="https://github.com/user-attachments/assets/a8a784b4-8672-4b02-bb21-e4a749682f2e">
This commit is contained in:
@ -30,7 +30,6 @@ export const EditableFilterDropdownButton = ({
|
||||
setFilterDefinitionUsedInDropdown,
|
||||
setSelectedOperandInDropdown,
|
||||
setSelectedFilter,
|
||||
setIsObjectFilterDropdownOperandSelectUnfolded,
|
||||
} = useFilterDropdown({
|
||||
filterDropdownId: viewFilterDropdownId,
|
||||
});
|
||||
@ -87,10 +86,6 @@ export const EditableFilterDropdownButton = ({
|
||||
}
|
||||
}, [viewFilter, deleteCombinedViewFilter]);
|
||||
|
||||
const handleDropdownClose = useCallback(() => {
|
||||
setIsObjectFilterDropdownOperandSelectUnfolded(false);
|
||||
}, [setIsObjectFilterDropdownOperandSelectUnfolded]);
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
dropdownId={viewFilterDropdownId}
|
||||
@ -106,7 +101,6 @@ export const EditableFilterDropdownButton = ({
|
||||
dropdownOffset={{ y: 8, x: 0 }}
|
||||
dropdownPlacement="bottom-start"
|
||||
onClickOutside={handleDropdownClickOutside}
|
||||
onClose={handleDropdownClose}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user