fix(useResizable): share resize logic between mouse and touch - #263
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs upstream nuxt/ui commit
730a54c— fix(useResizable): share resize logic between mouse and touch (#6705).What
Deduplicates the identical
onMouseMove/onTouchMovebodies into a singleresize(clientX, initialPos, initialSize, rootFontSize)helper, and moves thegetComputedStyle(...).fontSizeread out of the per-move hot path: a newgetRootFontSize()runs once per drag inonMouseDown/onTouchStart(returning1when the unit isn'trem), avoiding a forced style recalc on every pointer move. The mouse/touch handlers now callresize()with the pointer'sclientX(touch guarded one.touches[0]), andonTouchMoveis 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 entryc257686reconciled to PR #262.🤖 Generated with Claude Code
Generated by Claude Code