From fc53007e473e7176912ac8ab6e05decf8fa3cd2f Mon Sep 17 00:00:00 2001 From: iliana etaoin Date: Mon, 15 Apr 2024 08:29:28 -0700 Subject: [PATCH] Remove use of `cssText` in react-focus-guards Violates Content-Security-Policy unless `style-src: 'unsafe-inline'` is permitted otherwise. --- .yarn/versions/4c2c950e.yml | 2 ++ packages/react/focus-guards/src/FocusGuards.tsx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .yarn/versions/4c2c950e.yml diff --git a/.yarn/versions/4c2c950e.yml b/.yarn/versions/4c2c950e.yml new file mode 100644 index 0000000000..79cfafe8e7 --- /dev/null +++ b/.yarn/versions/4c2c950e.yml @@ -0,0 +1,2 @@ +releases: + "@radix-ui/react-focus-guards": minor diff --git a/packages/react/focus-guards/src/FocusGuards.tsx b/packages/react/focus-guards/src/FocusGuards.tsx index 56be808bba..b277138b6e 100644 --- a/packages/react/focus-guards/src/FocusGuards.tsx +++ b/packages/react/focus-guards/src/FocusGuards.tsx @@ -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; }