-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade cropperjs to v2, add avatar id and link to it #33827
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the TS issue is fixed
There's also the initial area selection not working for some reason. It previously selects 50% of the area space, I think I would like to make that 100%. |
Still not fully working, but I pushed one related improvement: Clicking on the current user's avatar now adds the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping original author @kerwin612
</cropper-selection> | ||
</cropper-canvas> | ||
`); | ||
cropperCanvas.querySelector<CropperSelection>('cropper-selection').addEventListener('change', debounce(async (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This event is not right. For example: "zoom" won't trigger "change" event and users will get wrong image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally I would like to disable zooming, but found no way to do so.
Yes I wanted to limit the selection space, but the example code was rather complex. Maybe I will try again: https://fengyuanchen.github.io/cropperjs/v2/api/cropper-selection.html#limit-boundaries |
Update cropperjs to v2.
Potential upstream issue: fengyuanchen/cropperjs#1233No longer needed, we now re-create the element every time instead of updating.