Skip to content

Commit

Permalink
fix: no allow click outside to close
Browse files Browse the repository at this point in the history
  • Loading branch information
trmaphi committed Jun 14, 2024
1 parent 4d7b27b commit 5bb51a3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/frontend/src/components/Modals/ConfirmDelegatee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const ConfirmDelegateeModal = (props: ConfirmationModalProps) => {
}
const useOutsideAlerter = (ref: any) => {
useEffect(() => {
/**
* Alert if clicked on outside of element
*/
function handleClickOutside(event: any) {
if (ref.current && !ref.current.contains(event.target)) {
open(false);
}
}
// Bind the event listener
document.addEventListener("mousedown", handleClickOutside);
return () => {
// Unbind the event listener on clean up
document.removeEventListener("mousedown", handleClickOutside);
};
// /**
// * Alert if clicked on outside of element
// */
// function handleClickOutside(event: any) {
// if (ref.current && !ref.current.contains(event.target)) {
// open(false);
// }
// }
// // Bind the event listener
// document.addEventListener("mousedown", handleClickOutside);
// return () => {
// // Unbind the event listener on clean up
// document.removeEventListener("mousedown", handleClickOutside);
// };
}, []);
};

Expand Down

0 comments on commit 5bb51a3

Please sign in to comment.