Skip to content

v1.7.15 injects inline styles, violating strict CSP #2615

@unindented

Description

@unindented

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.7.15

What browser are you using?

Chrome, Firefox, Safari

Reproduction URL

https://codesandbox.io/p/sandbox/upbeat-wave-gx26wy

Describe your issue

Starting with v1.7.15, @headlessui/react injects this inline style when using Popover:

<div style="position:fixed;top:1px;left:1px;width:1px;height:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;display:none"></div>

This causes sites with strict CSP policies (not allowing 'unsafe-inline', e.g. style-src: 'self') to throw errors in the console.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions