Skip to content

Fix position prop being ignored since v15 - #441

Merged
mosch merged 3 commits into
mainfrom
fix/position-prop
Sep 30, 2026
Merged

mosch merged 3 commits into
mainfrom
fix/position-prop

Conversation

@mosch

@mosch mosch commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Fixes #436. Supersedes #437 and includes @EdwinKimsal's commit from it, so their authorship is kept.

Since the core refactor in v15.0.0, the position prop has been ignored completely. Images always started centered, and changing the prop did nothing. In v14 it was a controlled prop, which the README still describes.

  • Initial position (from Fixed initial position loading #437): the core reads position from its config when an image loads.
  • Controlled updates (new): a lib effect applies later position changes to the loaded image. It does nothing when the values already match, so drag → onPositionChange → position round-trips don't loop.

Tests:

  • core: loadImage() starts at the configured position.
  • lib: the image starts at position, and a rerender with a new position moves the crop. I checked that this test fails without the effect.

EdwinKimsal and others added 3 commits September 30, 2026 14:35
Restores controlled position behavior lost in the core refactor: the
prop is used as the initial position and later changes move the crop.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
react-avatar-editor f1aacf9 Commit Preview URL

Branch Preview URL
Sep 30 2026, 12:38 PM

@mosch
mosch merged commit d94476a into main Sep 30, 2026
2 checks passed
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.

AvatarEditor position prop not working on v15+

2 participants