Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 212f60061a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onTouchMove: (e) => { | ||
| setTouching(false); | ||
| onRelease(e); | ||
| }, |
There was a problem hiding this comment.
Fire release only once per touch gesture
onTouchMove unconditionally calls onRelease, so after onTouchStart a drag emits release on every move event, not just the first cancellation/end. In handlers that send "button up"/stop messages, this can trigger duplicate side effects and unnecessary traffic during a single press. onTouchMove should gate on the current pressed state (or otherwise ensure release is emitted once per gesture).
Useful? React with 👍 / 👎.
| onMouseUp: (e) => { | ||
| setTouching(false); | ||
| onRelease(e); |
There was a problem hiding this comment.
Avoid losing mouse release when pointer leaves element
For mouse interactions, release is handled only by the element-local onMouseUp. If the user presses, drags outside the element, and releases there, this handler is not invoked, so touching remains true and onRelease is skipped. That leaves long-press state stuck until a later interaction; capture release at window/pointer level (or equivalent leave/cancel handling) to make the state transition reliable.
Useful? React with 👍 / 👎.
No description provided.