react-advanced-cropper icon indicating copy to clipboard operation
react-advanced-cropper copied to clipboard

`parentSelector` to have Cropper working inside iframe

Open matteofrana opened this issue 1 year ago • 2 comments

Hi! I have a modal (react-modal) attached to a parent iframe (via parentSelector). Inside this modal I have the Cropper. The wheel event is working, while the cropping handles aren't working. I think it is because the Cropper attaches events to the current window, while I should have them attached to the iframe document: https://github.com/advanced-cropper/react-advanced-cropper/blob/283ec197f782f15e2889ad514a097cd977a068b3/src/components/service/DraggableElement.tsx#L218

I think this could be done by adding a parentSelector prop to the Cropper component and, if there is a parentSelector, attaching the events to it, instead of window.

What do you think about it?

matteofrana avatar Aug 14 '23 13:08 matteofrana

Or maybe it is possible to add the event listener to the container instead of window?

matteofrana avatar Aug 15 '23 09:08 matteofrana

@matteofrana, if this issue is still actual, could you provide the minimum reproducible example?

Norserium avatar Sep 29 '23 21:09 Norserium

@matteofrana, I close issue for now, but feel free to reopen.

Norserium avatar Jun 09 '24 17:06 Norserium