salesforce / design-system-react

Salesforce Lightning Design System for React
https://react.lightningdesignsystem.com/
BSD 3-Clause "New" or "Revised" License
908 stars 411 forks source link

Modals not rendering when LWS security flag is active. #3127

Open aYolandaBecerra opened 11 months ago

aYolandaBecerra commented 11 months ago

Hi All,

We are using the Modals from desing-system-react (version 0.10.54) in our proyect, we have detected that when the LWS security flag is active, the modals throw an error and it does not render.

the error leads us to ModalPortals.js. a file inside react-modal lib (version 3.14.3) imported by desing-system-react.

please can you check why its not working with LWS security?

welcome[bot] commented 11 months ago

Thanks for opening your first issue! :wave: If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.

interactivellama commented 10 months ago

The Modal renders into the body tag. I would estimate that LWS is blocking access to the body tag. You might try a different parentSelector https://react.lightningdesignsystem.com/components/modals/#prop-parentSelector

konstantinosBlatsoukasRepo commented 8 months ago

Hi all, do we have any news regarding the issue, I face the same problem my react app crashes. @interactivellama I would like a big favour, can you give a concrete example of the above? Thanks!

interactivellama commented 8 months ago

parentSelector is an exposed mapping of this function from React Modal. https://reactcommunity.org/react-modal/#using-a-custom-parent-node