Closed james2406 closed 3 years ago
Hi @james2406. Thanks for the PR! 🙏
I haven't played much with iframes so this use case is new to me. Would it be possible for you to provide an example of how a bottom sheet can be used inside an iframe?
Sure thing. I'll probably have some time this weekend to put something together and link it here when it's ready
I created a sandbox where you can see the content rendering outside of the iframe https://codesandbox.io/s/react-modal-sheet-iframe-xyfim. If you point the package.json to my fork, you'll see the content renders in the iframe.
The styled-components library has quite a nice way to handle this via a StyleSheetManager - which allows you to provide the
element of the current document via the target prop. However, that approach is probably a bit over the top for this case.Thank you @james2406!
I'll create a new example for this use case in my /examples
folder and add the new prop for a custom document 👍
Awesome. Thanks a lot!
I was just thinking today, do you think a more flexible solution would be to allow users of this library to change the portal domNode instead of providing a different document? This would solve the problem for people with iframes + allow anyone to change the rendering dom node (for whatever reason).
I'd be more than happy to submit another PR + create another example sandbox if you agree.
Awesome. Thanks a lot!
I was just thinking today, do you think a more flexible solution would be to allow users of this library to change the portal domNode instead of providing a different document? This would solve the problem for people with iframes + allow anyone to change the rendering dom node (for whatever reason).
@james2406 yeah that might actually be a better solution 👍
Another PR for this idea is definitely welcome 🙏
PS: I just released 1.0.0
that dropped the support for framer-motion
v1 which fixed some TS issues.
I quickly tested your initial iframe example and it seems that the gestures (dragging from the header) are not working inside the iframe 🤔
I'm going to close this for inactivity. Please update the PR with a working solution if this feature is still important to have in the lib 🙂
Hi @Temzasse. First of all, thank you for creating this library! It looks fantastic and has such an intuitive + flexible API.
This change would allow a custom document to be provided (useful in cases where you are rendering into an iframe).
Let me know what you think :)