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
+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({