refactor: migrate touch and mouse click handling to native onClick event to improve interaction reliability
This commit is contained in:
@@ -82,7 +82,7 @@ function EventItem({
|
||||
|
||||
const handleClick = () => {
|
||||
cancelPress();
|
||||
if (!isLongPress.current && !isScrolling.current) {
|
||||
if (!isLongPress.current) {
|
||||
onClick();
|
||||
}
|
||||
};
|
||||
@@ -107,12 +107,13 @@ function EventItem({
|
||||
WebkitUserSelect: "none",
|
||||
}}
|
||||
onTouchStart={startPress}
|
||||
onTouchEnd={handleClick}
|
||||
onTouchEnd={cancelPress}
|
||||
onTouchMove={handleTouchMove}
|
||||
onTouchCancel={cancelPress}
|
||||
onMouseDown={startPress}
|
||||
onMouseUp={handleClick}
|
||||
onMouseUp={cancelPress}
|
||||
onMouseLeave={cancelPress}
|
||||
onClick={handleClick}
|
||||
onContextMenu={(e) => e.preventDefault()} // Prevent context menu on long press
|
||||
>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user