finos / openfin-react-hooks

A collection of React Hooks built on top of the Openfin API - from Scott Logic
Apache License 2.0
48 stars 18 forks source link

Ensure style and links are included for inheritCSS #48

Closed oriondean closed 4 years ago

oriondean commented 4 years ago

Currently CSS which is included within tags are not included into child windows when shouldInheritCss is selected. This can cause issues with applications which extract and minimise CSS from importing React components into a child window.

Fix modifies the shouldInheritCss method to ensure all style-sheet information is injected into a childWindow by using the parentDocument.styleSheets method instead of getElementsByTagName. Updated the demo application as well to include a CSS property on the useChildWindow injected JSX component. Issues are known to @ColinEberhardt who requested this to be investigated and fixed.

jlight-scottlogic commented 4 years ago

Should we also be bumping the package version?