-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Block the user from zooming the image #1232
Comments
Listen on the |
Typescript will not allow me to use "event.detail.action". I've tried this instead:
But preventDefault() does not stop the zoom. |
Try to listen on the |
I can do that, but then the Image can't scale at all, and just displays at it's natural size. I've tried this: cropperCanvas?.addEventListener('action', (event) => { cropperImage?.addEventListener('transform', (event) => { But the user can still zoom the image a step or 2, before the event is cancelled. |
I have the exact same problem. Tried the same things with no luck:
What I did find is a weird hacky fix that uses the oldMatrix data to allow it to fit the canvas initially, and then prevent it afterwards:
but it doesn't look as a great solution. I hope someone finds a better one |
I'd like a way to set something like zoomable=false on the image.
Scalable=false does that, BUT it also makes the image show up on the canvas in it's natural size.
I'd like the image to be scaled for the canvas, but disallow the user to scale / zoom afterwards.
The text was updated successfully, but these errors were encountered: