Newly rendered component's styles are added to <head> of original window, and not in Document Picture-In-Picture window's <head> #40902
Labels
package: system
Specific to @mui/system
support: Stack Overflow
Please ask the community on Stack Overflow
v4.x
Hi there,
I created this blank issue since I wasn't sure if this was a bug, feature request or a support item. I've checked if there was a duplicate of this type of issue and there seems to not be any.
High level Issue:
When we have a Document Picture-In-Picture (DPIP) window open and a React component gets rendered within the DPIP window, the styles that are generated from its makeStyles are not being injected to the corresponding
<head>
element in the DPIP's DOM but instead are being injected to the<head>
of the original window's DOM.Context:
We have a chat in our application, and when you click on a button, you can open it in a DPIP window. We're following the examples provided on the Google developer page for this new DPIP functionality to create the DPIP window and copy the stylesheets over. We are also using createPortal from React, to take our chat and render it inside the DPIP window's
<body>
.Essentially if our chat moves to the DPIP window and there are no message components rendered initially (no messages have been sent in the chat), and a message is then sent/received, their styles do not get applied. Pretty much any component that wasn't rendered initially in the original window will have the same problem.
Does anyone have any insight as to what may be happening here? Is there a way to tell MUI to inject the styles into this new
<head>
? Any help is appreciated.Search keywords:
The text was updated successfully, but these errors were encountered: