Repository navigation
Fix position prop being ignored since v15 - #441
Merged
Merged
Conversation
Restores controlled position behavior lost in the core refactor: the prop is used as the initial position and later changes move the crop.
Deploying with
|
| 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 |
This was referenced Sep 30, 2026
Merged
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.
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
positionprop 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.positionfrom its config when an image loads.positionchanges to the loaded image. It does nothing when the values already match, so drag →onPositionChange→positionround-trips don't loop.Tests:
loadImage()starts at the configured position.position, and a rerender with a newpositionmoves the crop. I checked that this test fails without the effect.