Skip to content

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

ref(accessibility): add an aria-expended attribute if the the button open menu (#14023)

AHMAD KADRIff656a062523
diff --git a/react/features/base/toolbox/components/AbstractButton.tsx b/react/features/base/toolbox/components/AbstractButton.tsx
index 7472163bc5..f5771a8366 100644
--- a/react/features/base/toolbox/components/AbstractButton.tsx
+++ b/react/features/base/toolbox/components/AbstractButton.tsx
@@ -53,6 +53,11 @@ export interface IProps extends WithTranslation {
*/
handleClick?: Function;
+ /**
+ * Whether the button open a menu or not.
+ */
+ isMenuButton?: boolean;
+
/**
* Notify mode for `toolbarButtonClicked` event -
* whether to only notify or to also prevent button click routine.
@@ -102,7 +107,7 @@ export const defaultDisabledButtonStyles = {
/**
* An abstract implementation of a button.
*/
-export default class AbstractButton<P extends IProps, S=any> extends Component<P, S> {
+export default class AbstractButton<P extends IProps, S = any> extends Component<P, S> {
static defaultProps = {
afterClick: undefined,
disabledStyles: defaultDisabledButtonStyles,
@@ -354,7 +359,7 @@ export default class AbstractButton<P extends IProps, S=any> extends Component<P
if (typeof APP !== 'undefined' && notifyMode) {
APP.API.notifyToolbarButtonClicked(
- buttonKey, notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
+ buttonKey, notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
);
}
diff --git a/react/features/base/toolbox/components/ToolboxItem.web.tsx b/react/features/base/toolbox/components/ToolboxItem.web.tsx
index e8f9107e79..b198e6a049 100644
--- a/react/features/base/toolbox/components/ToolboxItem.web.tsx
+++ b/react/features/base/toolbox/components/ToolboxItem.web.tsx
@@ -19,6 +19,11 @@ interface IProps extends AbstractToolboxItemProps {
*/
contextMenu?: boolean;
+ /**
+ * Whether the button open a menu or not.
+ */
+ isMenuButton?: boolean;
+
/**
* On key down handler.
*/
@@ -67,6 +72,7 @@ export default class ToolboxItem extends AbstractToolboxItem<IProps> {
const {
backgroundColor,
contextMenu,
+ isMenuButton,
disabled,
elementAfter,
icon,
@@ -77,8 +83,9 @@ export default class ToolboxItem extends AbstractToolboxItem<IProps> {
toggled
} = this.props;
const className = showLabel ? 'overflow-menu-item' : 'toolbox-button';
+ const buttonAttribute = isMenuButton ? 'aria-expanded' : 'aria-pressed';
const props = {
- 'aria-pressed': toggled,
+ [buttonAttribute]: toggled,
'aria-disabled': disabled,
'aria-label': this.accessibilityLabel,
className: className + (disabled ? ' disabled' : ''),
diff --git a/react/features/toolbox/components/web/OverflowMenuButton.tsx b/react/features/toolbox/components/web/OverflowMenuButton.tsx
index e019a8a202..35fb6f7139 100644
--- a/react/features/toolbox/components/web/OverflowMenuButton.tsx
+++ b/react/features/toolbox/components/web/OverflowMenuButton.tsx
@@ -238,6 +238,7 @@ const OverflowMenuButton = ({
trigger = 'click'
visible = { isOpen }>
<OverflowToggleButton
+ isMenuButton = { true }
isOpen = { isOpen }
onKeyDown = { onEscClick } />
</Popover>