Skip to content

AvatarEditor position prop not working on v15+ #436

@juanamd

Description

@juanamd

Upgraded to latest version (15.1.0) and the position prop is no longer working as it is being ignored.
Panning and dragging the image fires onPositionChange successfully with the correct position. Just the initial position passed as prop is ignored.

I quickly glanced over the code and noticed that on AvatarEditor core, the getCroppingRect() function is never called with the position parameter like:
getCroppingRect(position)
As the position parameter is optional.

In contrast, in v14, getCroppingRect() internally uses the position from props, like so:
const position = this.props.position || { x: this.state.image.x, y: this.state.image.y, }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions