Skip to content

Extend input utility functions#136

Merged
s0 merged 2 commits intomainfrom
input-utils
Mar 24, 2026
Merged

Extend input utility functions#136
s0 merged 2 commits intomainfrom
input-utils

Conversation

@s0
Copy link
Copy Markdown
Member

@s0 s0 commented Mar 24, 2026

No description provided.

@s0 s0 enabled auto-merge (squash) March 24, 2026 20:48
@s0 s0 merged commit 93af95f into main Mar 24, 2026
4 checks passed
@s0 s0 deleted the input-utils branch March 24, 2026 20:49
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +95 to +98
onTouchMove: (e) => {
setTouching(false);
onRelease(e);
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +91 to +93
onMouseUp: (e) => {
setTouching(false);
onRelease(e);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant