You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue, when putting MUI Slider into Shadow DOM. While I managed to inject its styles via StylesProvider and jss, I still have a problem with badly styled tooltips, indicating the selected value.
The issue is present in the latest release.
I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
The problem is that the tooltips are shown at the end of document.body (via some portal, I suppose). This causes the tooltips not being styled, because its styles are injected into Shadow DOM, which ensures encapsulation.
Expected Behavior 🤔
Possibility of passing custom root prop for tooltips, that defaults to document.body.
Steps to Reproduce 🕹
Steps:
Attach shadow root to some container
Wrap the content into StylesProvider using jss
Put Slider inside
Context 🔦
Your Environment 🌎
@material-ui/core 4.9.10
jss 10.5.1
react 17.0.1
The text was updated successfully, but these errors were encountered:
See #17473. We currently don't aim to support shadow DOM natively. We leave it up to each developer to do the legwork. If you have a live reproduction on CodeSandbox, please share it there. The community might help, StackOverflow could be another place to ask too.
Not helpful at all, but I finally managed to solve the problem. I'll leave it here for anyone having the same.
So I passed MUI Tooltip component to the Slider as the ValueLabelComponent, which used PopperProps. It accepts container prop, where I passed a reference to my container, instead of default document.body.
Hi,
I have an issue, when putting MUI Slider into Shadow DOM. While I managed to inject its styles via StylesProvider and jss, I still have a problem with badly styled tooltips, indicating the selected value.
Current Behavior 😯
The problem is that the tooltips are shown at the end of document.body (via some portal, I suppose). This causes the tooltips not being styled, because its styles are injected into Shadow DOM, which ensures encapsulation.
Expected Behavior 🤔
Possibility of passing custom root prop for tooltips, that defaults to document.body.
Steps to Reproduce 🕹
Steps:
Context 🔦
Your Environment 🌎
The text was updated successfully, but these errors were encountered: