Add support for AnimatePresence when using shadow DOM
By default this was using document.head, but that is not always available to where it's rendered, e.g. when using the shadow DOM. In such cases, this change allows for the shadow root to be passed to the new parentDOM prop. This change is backwards compatible since we default to document.head when not specified.
Fixes https://github.com/framer/motion/issues/2508
Hey @mattgperry, do you know what the process is to get this change merged?
hi @mattgperry the pipeline is passing and I just updated the latest conflicts on the CHANGELOG, let me know if you are able to review and approve this or is there someone else I should ping? thanks!
@kurtextrem is this something you can help with?
@SaeWooKKang @mattgperry this is a blocker for me would be huge to get this merged 🙏
Hey! I had a brief look, it looks good to me. I've forwarded the PR.
Thanks for taking a look @mattgperry ! I've added the tests as requested and updated the prop to root
btw as an alternative to enabling the experimental flag to test the shadow dom in cypress, I did try upgrading cypress to 5.2.0 where the behaviour is enabled by default. The tests still passed, but I was wary of mixing the upgrading of a major version in with this in case there was something else I've missed