react-advanced-cropper
react-advanced-cropper copied to clipboard
`parentSelector` to have Cropper working inside iframe
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?
Or maybe it is possible to add the event listener to the container
instead of window?
@matteofrana, if this issue is still actual, could you provide the minimum reproducible example?
@matteofrana, I close issue for now, but feel free to reopen.