Prevent the desktop context menu from appearing on mobile

This commit is contained in:
Gigiaj 2025-06-22 03:35:21 -05:00
parent 622521ca0a
commit 4963142ed4

View file

@ -433,10 +433,12 @@ function SpaceTab({
const handleContextMenu: MouseEventHandler<HTMLButtonElement> = (evt) => { const handleContextMenu: MouseEventHandler<HTMLButtonElement> = (evt) => {
evt.preventDefault(); evt.preventDefault();
const cords = evt.currentTarget.getBoundingClientRect(); const cords = evt.currentTarget.getBoundingClientRect();
if (!isMobile) {
setMenuAnchor((currentState) => { setMenuAnchor((currentState) => {
if (currentState) return undefined; if (currentState) return undefined;
return cords; return cords;
}); });
}
}; };
const longPressBinder = useLongPress( const longPressBinder = useLongPress(