react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

[BUG] CSP breaks, styles are injected even after disableStyleInjection is used

Open madhukivera opened this issue 1 year ago • 2 comments

Bug description

While https://github.com/ReactTooltip/react-tooltip/issues/1059 claims the disableStyleInjection works. However it does not Even after sending 'core' | 'true' as values, the library still injects styles, causing issues with CSP. Only after adding 'unsafe-inline' the errors go away, which seems to defeat the purpose of CSP

Version of Package ^5.25.2

To Reproduce Add CSP to webpage Send disableStyleInjection = 'core' or true

Expected behavior

We should not add 'unsafe-inline' to CSP

madhukivera avatar Feb 06 '24 04:02 madhukivera

disableStyleInjection should work as expected. The error you're seeing is probably due to using import "react-tooltip/dist/react-tooltip.css";.

How are you injecting CSS styles into your application? Instead of importing the react-tooltip.css file, you might need to copy its content manually to your own CSS files (try copying from node_modules/react-tooltip/dist/react-tooltip.css).

gabrieljablonski avatar Feb 06 '24 13:02 gabrieljablonski

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

github-actions[bot] avatar May 09 '24 12:05 github-actions[bot]