Semantic-Org / Semantic-UI-React

The official Semantic-UI-React integration
https://react.semantic-ui.com
MIT License
13.2k stars 4.04k forks source link

Popup: Unable to control where container is rendered #4425

Closed neutraali closed 1 year ago

neutraali commented 1 year ago

Concerning Popup (semantic-ui-react@2.0.3), I am unable to control where "popup container" appears (e.g. the one you can modify with props.popper). By default it seems to get rendered as a child of <body>.

This is an issue with web components that have a closed shadow DOM. The popup itself works, but any styles contained within the component itself will be invisible to the popup itself. Using the browser inspector, if I move the "popup container" inside the web component shadow DOM, the styles will be applied as normal.

Is there a way to control where the "popup container" appears or is it just a missing feature? I didn't find anything related specifically to this at the SUIR docs or the Popper.js docs.

neutraali commented 1 year ago

This was actually solved by looking at issue 4187 - Apparently you can pass mountNode to Popup, it just isn't documented anywhere.