Skip to content

fix(react): recognize swipes at coordinate zero - #1452

Open
fatihcvs wants to merge 1 commit into
livekit:mainfrom
fatihcvs:fix/swipe-zero-coordinate
Open

fatihcvs wants to merge 1 commit into
livekit:mainfrom
fatihcvs:fix/swipe-zero-coordinate

Conversation

@fatihcvs

Copy link
Copy Markdown

useSwipe treats a clientX coordinate of 0 as if no touch was recorded. A swipe from 0 to 100 (or 100 to 0) never calls its direction callback, affecting grid pagination at the viewport edge.

Check for the null sentinel explicitly so zero remains a valid coordinate. The distance threshold and callback direction are unchanged. Includes a React patch changeset.

Validation:

  • Five DOM-event tests exercise the real hook in JSDOM: both zero-coordinate cases failed before the fix; all five pass after it. Non-zero swipes, taps, short movements and the exact custom threshold are covered.
  • React/core/styles: 123 tests pass. React build (three package tasks), React lint, repository format and React API checks pass.
  • This verifies dispatched touch events in JSDOM, not physical-device touch behavior.

Developed and verified with OpenAI Codex assistance.

@changeset-bot

changeset-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: da98ffd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@livekit/components-react Patch
@livekit/agents-ui Patch
@livekit/component-example-next Patch
@livekit/components-js-docs Patch
@livekit/component-docs-storybook Patch
@livekit/components-docs-gen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

@fatihcvs is attempting to deploy a commit to the LiveKit Team on Vercel.

A member of the Team first needs to authorize it.

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