Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Use focus-visible for some focus styles to fix a11y issues (#12968)

Emmanuel Pelletiercfb8589bef2a
diff --git a/css/_welcome_page.scss b/css/_welcome_page.scss
index f938460c93..ebdae67f8f 100644
--- a/css/_welcome_page.scss
+++ b/css/_welcome_page.scss
@@ -90,7 +90,7 @@ body.welcome-page {
font-size: 14px;
padding-left: 10px;
- &:focus {
+ &.focus-visible {
outline: auto 2px #005fcc;
}
}
diff --git a/react/features/base/ui/components/web/Button.tsx b/react/features/base/ui/components/web/Button.tsx
index e00bfa412a..21a6ccd3bc 100644
--- a/react/features/base/ui/components/web/Button.tsx
+++ b/react/features/base/ui/components/web/Button.tsx
@@ -69,7 +69,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.action01Active
},
- '&:focus': {
+ '&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`
},
diff --git a/react/features/base/ui/components/web/ClickableIcon.tsx b/react/features/base/ui/components/web/ClickableIcon.tsx
index 91eea3def6..8cb19e9839 100644
--- a/react/features/base/ui/components/web/ClickableIcon.tsx
+++ b/react/features/base/ui/components/web/ClickableIcon.tsx
@@ -25,7 +25,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.ui02
},
- '&:focus': {
+ '&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`
},
diff --git a/react/features/base/ui/components/web/ContextMenuItem.tsx b/react/features/base/ui/components/web/ContextMenuItem.tsx
index b29377487f..3731dc38d6 100644
--- a/react/features/base/ui/components/web/ContextMenuItem.tsx
+++ b/react/features/base/ui/components/web/ContextMenuItem.tsx
@@ -110,7 +110,7 @@ const useStyles = makeStyles()(theme => {
backgroundColor: theme.palette.ui03
},
- '&:focus': {
+ '&.focus-visible': {
boxShadow: `inset 0 0 0 2px ${theme.palette.action01Hover}`
}
},
diff --git a/react/features/base/ui/components/web/Dialog.tsx b/react/features/base/ui/components/web/Dialog.tsx
index 4c5be132ef..69ac9d55ce 100644
--- a/react/features/base/ui/components/web/Dialog.tsx
+++ b/react/features/base/ui/components/web/Dialog.tsx
@@ -23,12 +23,6 @@ const useStyles = makeStyles()(theme => {
justifyContent: 'space-between'
},
- closeIcon: {
- '&:focus': {
- boxShadow: 'none'
- }
- },
-
title: {
color: theme.palette.text01,
...withPixelLineHeight(theme.typography.heading5),
@@ -138,7 +132,6 @@ const Dialog = ({
{!hideCloseButton && (
<ClickableIcon
accessibilityLabel = { t('dialog.close') }
- className = { classes.closeIcon }
icon = { IconCloseLarge }
id = 'modal-header-close-button'
onClick = { onClose } />
diff --git a/react/features/base/ui/components/web/DialogWithTabs.tsx b/react/features/base/ui/components/web/DialogWithTabs.tsx
index c798169d88..77c78afd3c 100644
--- a/react/features/base/ui/components/web/DialogWithTabs.tsx
+++ b/react/features/base/ui/components/web/DialogWithTabs.tsx
@@ -112,12 +112,6 @@ const useStyles = makeStyles()(theme => {
}
},
- closeIcon: {
- '&:focus': {
- boxShadow: 'none'
- }
- },
-
content: {
flexGrow: 1,
overflowY: 'auto',
@@ -259,7 +253,6 @@ const DialogWithTabs = ({
const closeIcon = useMemo(() => (
<ClickableIcon
accessibilityLabel = { t('dialog.close') }
- className = { classes.closeIcon }
icon = { IconCloseLarge }
id = 'modal-header-close-button'
onClick = { onClose } />
@@ -299,7 +292,6 @@ const DialogWithTabs = ({
<span className = { classes.backContainer }>
<ClickableIcon
accessibilityLabel = { t('dialog.Back') }
- className = { classes.closeIcon }
icon = { IconArrowBack }
id = 'modal-header-back-button'
onClick = { back } />
diff --git a/react/features/base/ui/components/web/Tabs.tsx b/react/features/base/ui/components/web/Tabs.tsx
index 61866886ac..e198d5cda2 100644
--- a/react/features/base/ui/components/web/Tabs.tsx
+++ b/react/features/base/ui/components/web/Tabs.tsx
@@ -44,7 +44,7 @@ const useStyles = makeStyles()(theme => {
borderColor: theme.palette.ui10
},
- '&:focus': {
+ '&.focus-visible': {
outline: 0,
boxShadow: `0px 0px 0px 2px ${theme.palette.focus01}`,
border: 0,
diff --git a/react/features/video-quality/components/Slider.web.tsx b/react/features/video-quality/components/Slider.web.tsx
index afefbfd70e..a4b23f1682 100644
--- a/react/features/video-quality/components/Slider.web.tsx
+++ b/react/features/video-quality/components/Slider.web.tsx
@@ -94,7 +94,7 @@ const useStyles = makeStyles()(theme => {
top: 0,
width: '100%',
- '&:focus': {
+ '&.focus-visible': {
// override global styles in order to use our own color
outline: 'none !important',