cleanup and context menu fixes

This commit is contained in:
subnub
2025-01-11 02:56:34 -05:00
parent 56c57a6cdf
commit 1ab318fd2c
3 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -95,7 +95,7 @@
"regenerator-runtime": "^0.13.3",
"sharp": "^0.33.4",
"supertest-session": "^4.1.0",
"sweetalert2": "^11.6.13",
"sweetalert2": "^11.15.10",
"temp": "^0.9.1",
"typescript": "^5.4.5",
"uuid": "^3.4.0",
+13 -1
View File
@@ -287,8 +287,20 @@ const ContextMenu: React.FC<ContextMenuProps> = memo((props) => {
}
};
const outterWrapperClick = (e: React.MouseEvent<HTMLDivElement>) => {
e.stopPropagation();
if ((e.target as HTMLDivElement).id !== "context-wrapper") {
return;
}
closeContext();
};
return (
<div className="w-screen dynamic-height absolute top-0 left-0 right-0 bottom-0 z-50 flex justify-center items-center flex-col">
<div
id="context-wrapper"
className="w-screen dynamic-height absolute top-0 left-0 right-0 bottom-0 z-50 flex justify-center items-center flex-col"
onClick={outterWrapperClick}
>
<div
onClick={stopPropagation}
ref={wrapperRef}
+2
View File
@@ -38,6 +38,8 @@ export const useContextMenu = () => {
let X = e.clientX || touches.clientX;
let Y = e.clientY || touches.clientY;
if (contextData.selected) return;
timeoutRef.current = setTimeout(() => {
console.log("timeout");
setContextData({