theKashey / react-remove-scroll

Removes and disables 📜in a "React" way
MIT License
782 stars 28 forks source link

Not working in iframe #112

Open seleckis opened 3 weeks ago

seleckis commented 3 weeks ago

Here is an example when RemoveScroll is used inside React Frame Component. The main body is locked but iframe is not. Codesandbox

theKashey commented 3 weeks ago

Thank you for a perfect example, I know what to do next

theKashey commented 3 weeks ago

update: that would take a while to update all required pieces. In short: react-remove-scroll should share "current document" (or just element) to react-remove-scroll-bar, which in turn should configure react-style-singleton to inject styles in the right place. Right now these styles are always injected to the document of a "script", and in case operation is performed in another iframe it ends non locked.

While the change is simple, it has to be done in many places and require API update.

seleckis commented 3 weeks ago

Wow, that fragmentation is unexpected :)