Skip to content

fix(drag): resample when the restriction path changes - #2032

Open
Shubham-Padkonde wants to merge 1 commit into
airbnb:masterfrom
Shubham-Padkonde:fix/resample-replaced-drag-path
Open

Shubham-Padkonde wants to merge 1 commit into
airbnb:masterfrom
Shubham-Padkonde:fix/resample-replaced-drag-path

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

When restrictToPath switches to another SVG geometry with the same total length, useSamplesAlongPath reuses points from the previous element. Dragging remains constrained to the old path.

Include the path element in the memo dependencies while retaining the length dependency. Add a regression for switching equal-length paths and a check that an unchanged path reuses its samples.

Validation: the replacement-path regression fails before the fix; all 8 tests across the 5 visx-drag test files pass afterward. Prettier passes for both changed files. Tests ran with Vitest/jsdom and the package configuration; the full monorepo build was not run.

Prepared with Codex assistance.

This branch has not been deployed

No deployments
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