chore: remove clear seleciton logic on escape key press (#4735)

This commit is contained in:
Aaryan Khandelwal 2024-06-07 18:18:47 +05:30 committed by GitHub
parent 1561b710ca
commit 17ce1bceb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -271,20 +271,6 @@ export const useMultipleSelect = (props: Props) => {
[disabled, entitiesList, handleEntitySelection, isGroupSelected] [disabled, entitiesList, handleEntitySelection, isGroupSelected]
); );
// clear selection on escape key press
useEffect(() => {
if (disabled) return;
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape") clearSelection();
};
window.addEventListener("keydown", handleKeyDown);
return () => {
window.removeEventListener("keydown", handleKeyDown);
};
}, [clearSelection, disabled]);
// select entities on shift + arrow up/down key press // select entities on shift + arrow up/down key press
useEffect(() => { useEffect(() => {
if (disabled) return; if (disabled) return;