mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Prevent the desktop context menu from appearing on mobile
This commit is contained in:
parent
622521ca0a
commit
4963142ed4
1 changed files with 6 additions and 4 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue