From 51839dd780bbab81edcdb97d76ef8ebb1637b3a3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 15 Aug 2024 10:10:51 -0400 Subject: [PATCH] fix: Unable to scroll elements in latest chrome (#7394) --- app/components/Button.tsx | 2 +- app/components/ContextMenu/MenuItem.tsx | 2 +- app/components/ContextMenu/index.tsx | 2 +- app/components/InputSelect.tsx | 2 +- app/index.tsx | 1 - package.json | 1 - shared/styles/globals.ts | 7 +------ yarn.lock | 5 ----- 8 files changed, 5 insertions(+), 17 deletions(-) diff --git a/app/components/Button.tsx b/app/components/Button.tsx index aadd4e00c1..d5ba543934 100644 --- a/app/components/Button.tsx +++ b/app/components/Button.tsx @@ -105,7 +105,7 @@ const RealButton = styled(ActionButton)` background: ${lighten(0.05, props.theme.danger)}; } - &.focus-visible { + &:focus-visible { outline-color: ${darken(0.2, props.theme.danger)} !important; } `}; diff --git a/app/components/ContextMenu/MenuItem.tsx b/app/components/ContextMenu/MenuItem.tsx index 939f84f87b..97e4cfd30e 100644 --- a/app/components/ContextMenu/MenuItem.tsx +++ b/app/components/ContextMenu/MenuItem.tsx @@ -152,7 +152,7 @@ export const MenuAnchorCSS = css` @media (hover: hover) { &:hover, &:focus, - &.focus-visible { + &:focus-visible { color: ${props.theme.accentText}; background: ${props.dangerous ? props.theme.danger : props.theme.accent}; box-shadow: none; diff --git a/app/components/ContextMenu/index.tsx b/app/components/ContextMenu/index.tsx index 766eb33e22..7b3585c396 100644 --- a/app/components/ContextMenu/index.tsx +++ b/app/components/ContextMenu/index.tsx @@ -223,7 +223,7 @@ export const Position = styled.div` position: absolute; z-index: ${depths.menu}; - &.focus-visible { + &:focus-visible { transition-delay: 250ms; transition-property: outline-width; transition-duration: 0; diff --git a/app/components/InputSelect.tsx b/app/components/InputSelect.tsx index 0125127772..fc231957a3 100644 --- a/app/components/InputSelect.tsx +++ b/app/components/InputSelect.tsx @@ -352,7 +352,7 @@ const Wrapper = styled.label<{ short?: boolean }>` `; export const Positioner = styled(Position)` - &.focus-visible { + &:focus-visible { ${StyledSelectOption} { &[aria-selected="true"] { color: ${(props) => props.theme.white}; diff --git a/app/index.tsx b/app/index.tsx index 2f8c8c5d23..eba27d6bc8 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,6 +1,5 @@ // eslint-disable-next-line import/no-unresolved import "vite/modulepreload-polyfill"; -import "focus-visible"; import { LazyMotion } from "framer-motion"; import { KBarProvider } from "kbar"; import { Provider } from "mobx-react"; diff --git a/package.json b/package.json index 0e5cdaa7af..534d43c8b8 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "fast-deep-equal": "^3.1.3", "fetch-retry": "^5.0.6", "fetch-with-proxy": "^3.0.1", - "focus-visible": "^5.2.0", "form-data": "^4.0.0", "fractional-index": "^1.0.0", "framer-motion": "^4.1.17", diff --git a/shared/styles/globals.ts b/shared/styles/globals.ts index d88dd3e28a..e7edd46bc6 100644 --- a/shared/styles/globals.ts +++ b/shared/styles/globals.ts @@ -105,12 +105,7 @@ export default createGlobalStyle` border-top: 1px solid ${s("divider")}; } - .js-focus-visible :focus:not(.focus-visible) { - outline: none; - outline-width: 0; - } - - .js-focus-visible .focus-visible { + :focus-visible { outline-color: ${s("accent")}; outline-offset: -1px; outline-width: initial; diff --git a/yarn.lock b/yarn.lock index a5b59ccb18..cdf62bb7d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8635,11 +8635,6 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity "sha1-JsrYAXlnrqhzG8QpYdBKPVmIrMw= sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" -focus-visible@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.2.0.tgz#3a9e41fccf587bd25dcc2ef045508284f0a4d6b3" - integrity "sha1-Op5B/M9Ye9JdzC7wRVCChPCk1rM= sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ==" - follow-redirects@^1.15.6: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"