cleanup and context menu fixes
This commit is contained in:
+1
-1
@@ -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",
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user