fix: trigger onClickOutside when click escape for closing the model a… (#12461)

Description:
Resolved a bug where pressing the Escape key did not clear the filter
chips when no filter value was present.
Added a call to onClickOutside inside the useScopedHotkeys hook to
ensure filter chips are removed when Escape is pressed and the dropdown
is open but empty.



https://github.com/user-attachments/assets/42ed35b0-f5a8-4d26-8407-fdd5e2cc4a42

fix #12319
This commit is contained in:
Ajay A Adsule
2025-06-09 18:38:57 +05:30
committed by GitHub
parent ecf21774dd
commit da35a2f479

View File

@ -30,7 +30,7 @@ export const EditableFilterDropdownButton = ({
removeRecordFilter({ recordFilterId: recordFilter.id });
};
const handleDropdownClickOutside = useCallback(() => {
const onFilterDropdownClose = useCallback(() => {
const recordFilterIsEmpty = isRecordFilterConsideredEmpty(recordFilter);
if (recordFilterIsEmpty) {
@ -62,7 +62,7 @@ export const EditableFilterDropdownButton = ({
dropdownHotkeyScope={hotkeyScope}
dropdownOffset={{ y: 8, x: 0 }}
dropdownPlacement="bottom-start"
onClickOutside={handleDropdownClickOutside}
onClose={onFilterDropdownClose}
/>
</>
);