-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add support for running an srcDoc style iFrame #410
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 996534c:
|
@ValentinH have just left this as draft for now so you can check if you are happy with the general approach or not - if you are I will sort the remaining type issues and add some extra tests before getting a full review. |
@ValentinH I think it should be good to go. All the existing e2e tests pass with the change in place, and I added one additional test to make sure the styles get applied to the iframe doc - let me know if you think we need any additional tests on top of this. |
All good! |
🚀 PR was released in |
Big thanks for the quick turnaround on this @ValentinH! |
As noted here, there are some instances where iFraming
react-easy-crop
causes the styles and events to be lost as they are always attached to the globalwindow
anddocument
.This PR changes the
Cropper
componentDidMount
method to instead get thedocument
andwindow
references from the currentcontainerRef
if it is defined.The PR also adds an iFramed version of the component to the example page to allow for testing. This can be accessed via
http://localhost:3001/?iframed=true
.