fengyuanchen / cropperjs

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

Cropend function not called when dragging to iframe #393

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello guys,

I am solving strange problem. My image crop view is very near to iframe. When I am cropping and then release mouse button(EVENT_POINTER_UP) on this iframe, function cropend is never called and it cause wrong behaviour after returning. When I release button on different place is working fine.

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report 
[ ] Feature request
[ ] Documentation issue or request

Current behavior

When I am cropping and then release mouse button(EVENT_POINTER_UP) on this iframe, function cropend is never called.

Expected behavior

Function cropend should be called.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Cropper.js version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

Others:

fengyuanchen commented 6 years ago

An <iframe> element has its own window and document, so the cropend will not been triggered in this cross-window case.

vkocib commented 2 years ago

This should be possible to fix with pointerleave event.