Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
chore(wcag) Make the video menu HTML valid for accessibility
raduanastase8x888b45c918225
diff --git a/react/features/base/popover/components/Popover.web.tsx b/react/features/base/popover/components/Popover.web.tsxindex 9f1c2c67fe..0052f2765f 100644--- a/react/features/base/popover/components/Popover.web.tsx+++ b/react/features/base/popover/components/Popover.web.tsx@@ -88,6 +88,11 @@ interface IProps {*/position: string;+ /**+ * The ARIA role.+ */+ role?: string;+/*** Whether the trigger for open/ close should be click or hover.*/@@ -483,20 +488,24 @@ class Popover extends Component<IProps, IState> {* @returns {ReactElement}*/_renderContent() {- const { content, position, trigger, headingId, headingLabel } = this.props;+ const { content, position, trigger, headingId, headingLabel, role = 'dialog' } = this.props;+ const isFocusLockEnabled = this.state.enableFocusLock;+ const isDialogRole = role === 'dialog';return (<div className = { `popover ${trigger}` }><divclassName = { `popover-content ${position.split('-')[0]}` }- data-autofocus = { this.state.enableFocusLock }+ data-autofocus = { isFocusLockEnabled }onKeyDown = { this._onEscKey }- { ...(this.state.enableFocusLock && {+ { ...(isFocusLockEnabled && {+ role,+ tabIndex: -1+ }) }+ { ...(isFocusLockEnabled && isDialogRole && {'aria-modal': true,'aria-label': !headingId && headingLabel ? headingLabel : undefined,- 'aria-labelledby': headingId,- role: 'dialog',- tabIndex: -1+ 'aria-labelledby': headingId ? headingId : undefined}) }>{ content }</div>diff --git a/react/features/base/ui/components/web/ContextMenuItem.tsx b/react/features/base/ui/components/web/ContextMenuItem.tsxindex e41352f95b..8cd61981fa 100644--- a/react/features/base/ui/components/web/ContextMenuItem.tsx+++ b/react/features/base/ui/components/web/ContextMenuItem.tsx@@ -224,7 +224,7 @@ const ContextMenuItem = ({tabIndex = selected ? 0 : -1;}- if (role === 'button' && !disabled) {+ if ((role === 'button' || role === 'menuitem') && !disabled) {tabIndex = 0;}diff --git a/react/features/base/ui/components/web/ContextMenuItemGroup.tsx b/react/features/base/ui/components/web/ContextMenuItemGroup.tsxindex 6e54ee6d77..004e1a3ff4 100644--- a/react/features/base/ui/components/web/ContextMenuItemGroup.tsx+++ b/react/features/base/ui/components/web/ContextMenuItemGroup.tsx@@ -15,6 +15,11 @@ interface IProps {* The children of the component.*/children?: ReactNode;++ /**+ * The optional role of the component.+ */+ role?: string;}const useStyles = makeStyles()(theme => {@@ -41,12 +46,15 @@ const useStyles = makeStyles()(theme => {const ContextMenuItemGroup = ({actions,- children+ children,+ ...rest}: IProps) => {const { classes: styles } = useStyles();return (- <div className = { styles.contextMenuItemGroup }>+ <div+ className = { styles.contextMenuItemGroup }+ { ...rest }>{children}{actions?.map(actionProps => (<ContextMenuItemdiff --git a/react/features/settings/components/web/video/VideoSettingsContent.tsx b/react/features/settings/components/web/video/VideoSettingsContent.tsxindex 00bfc8206e..c77be499e4 100644--- a/react/features/settings/components/web/video/VideoSettingsContent.tsx+++ b/react/features/settings/components/web/video/VideoSettingsContent.tsx@@ -257,6 +257,7 @@ const VideoSettingsContent = ({previewProps['aria-checked'] = true;previewProps.className = cx(classes.previewEntry, classes.selectedEntry);} else {+ previewProps['aria-checked'] = false;previewProps.onClick = _onEntryClick(deviceId);previewProps.onKeyPress = (e: React.KeyboardEvent) => {if (e.key === ' ' || e.key === 'Enter') {@@ -269,7 +270,7 @@ const VideoSettingsContent = ({return (<div{ ...previewProps }- role = 'radio'>+ role = 'menuitemradio'><div className = { classes.labelContainer }>{label && <div className = { classes.label }><span>{label}</span>@@ -303,25 +304,24 @@ const VideoSettingsContent = ({return (<ContextMenuactivateFocusTrap = { true }- aria-labelledby = 'video-settings-button'className = { classes.container }hidden = { false }- id = 'video-settings-dialog'- role = 'radiogroup'- tabIndex = { -1 }>- <ContextMenuItemGroup>+ id = 'video-settings-dialog'>+ <ContextMenuItemGroup role = 'group'>{trackData.map((data, i) => _renderPreviewEntry(data, i))}</ContextMenuItemGroup>- <ContextMenuItemGroup>+ <ContextMenuItemGroup role = 'group'>{ visibleVirtualBackground && <ContextMenuItemaccessibilityLabel = { t('virtualBackground.title') }icon = { IconImage }onClick = { selectBackground }+ role = 'menuitem'text = { t('virtualBackground.title') } /> }{!disableLocalVideoFlip && (<divclassName = { classes.checkboxContainer }- onClick = { stopPropagation }>+ onClick = { stopPropagation }+ role = 'menuitem'><Checkboxchecked = { localFlipX }label = { t('videothumbnail.mirrorVideo') }diff --git a/react/features/settings/components/web/video/VideoSettingsPopup.tsx b/react/features/settings/components/web/video/VideoSettingsPopup.tsxindex 1d82cc08fc..e0d29b1389 100644--- a/react/features/settings/components/web/video/VideoSettingsPopup.tsx+++ b/react/features/settings/components/web/video/VideoSettingsPopup.tsx@@ -93,6 +93,7 @@ function VideoSettingsPopup({headingId = 'video-settings-button'onPopoverClose = { onClose }position = { popupPlacement }+ role = 'menu'trigger = 'click'visible = { isOpen }>{ children }