Skip to content

fix(useResizable): share resize logic between mouse and touch - #263

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-730a54c
Jul 10, 2026
Merged

fix(useResizable): share resize logic between mouse and touch#263
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-730a54c

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Syncs upstream nuxt/ui commit 730a54cfix(useResizable): share resize logic between mouse and touch (#6705).

What

Deduplicates the identical onMouseMove / onTouchMove bodies into a single resize(clientX, initialPos, initialSize, rootFontSize) helper, and moves the getComputedStyle(...).fontSize read out of the per-move hot path: a new getRootFontSize() runs once per drag in onMouseDown / onTouchStart (returning 1 when the unit isn't rem), avoiding a forced style recalc on every pointer move. The mouse/touch handlers now call resize() with the pointer's clientX (touch guarded on e.touches[0]), and onTouchMove is removed.

b24ui's composable matched upstream exactly, so the refactor applied verbatim.

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green. Suite 5411 passed / 6 skipped (unchanged — no test/snapshot changes; the commit is composable-only).

Ledger: cursor advanced to 730a54c; previous entry c257686 reconciled to PR #262.

🤖 Generated with Claude Code


Generated by Claude Code

Deduplicate the identical onMouseMove/onTouchMove bodies into one
resize() helper, and hoist the getComputedStyle fontSize read out of the
per-move path (getRootFontSize is called once per drag). Handlers now
call resize() with the pointer's clientX; onTouchMove is removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik
IgorShevchik merged commit 8287439 into main Jul 10, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the sync/nuxt-730a54c branch July 10, 2026 15:55
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.

2 participants