fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
13.07k stars 2.41k forks source link

How to remove selection when user clicks on the image #1079

Open dmx974 opened 1 year ago

dmx974 commented 1 year ago

Hi, after searching for hours, I was not able to find a solution to this problem: I want the selection to disappear when I click outsite of it (like in photoshop). Seems to be a real challenge because the mousedown / mouseup event listeners has been disabled.

for instance, this is not working if I click on the area. It drives me crazy.

document.addEventListener('mousedown', onMouseDownHandler)
document.addEventListener('mouseup', onMouseUpHandler)

Anyone with a solution?

fengyuanchen commented 2 months ago

Was your problem solved?

fengyuanchen commented 2 months ago

If not, any more details? Can you provide an online demo?