Skip to content

Commit

Permalink
Remove use of cssText in react-focus-guards
Browse files Browse the repository at this point in the history
Violates Content-Security-Policy unless `style-src: 'unsafe-inline'` is
permitted otherwise.
  • Loading branch information
iliana committed Sep 27, 2024
1 parent e736efa commit fc53007
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .yarn/versions/4c2c950e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@radix-ui/react-focus-guards": minor
5 changes: 4 additions & 1 deletion packages/react/focus-guards/src/FocusGuards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function createFocusGuard() {
const element = document.createElement('span');
element.setAttribute('data-radix-focus-guard', '');
element.tabIndex = 0;
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
element.style.outline = 'none';
element.style.opacity = '0';
element.style.position = 'fixed';
element.style.pointerEvents = 'none';
return element;
}

Expand Down

0 comments on commit fc53007

Please sign in to comment.