Skip to content

Commit

Permalink
fix: a11y status for menu button
Browse files Browse the repository at this point in the history
  • Loading branch information
riddhybansal committed Oct 7, 2024
1 parent ffaf1fe commit 9128f40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/components/A11yStatus/A11yStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,18 @@ const A11yStatus = ({ components, layout }) => {
.includes(componentName.toLowerCase().replace(' ', ''));
});

const githubUrl = `https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/${componentName
.replace(/\b\w/g, (char) => char.toUpperCase())
.replace(/\s+/g, '')}`;
let githubUrl = '';
if (componentName === 'Menu buttons') {
const githubComponentName = 'Menu button';
githubUrl = `https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/${githubComponentName
.replace(/\b\w/g, (char) => char.toUpperCase())
.replace(/\s+/g, '')}`;
}
else {
githubUrl = `https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/${componentName
.replace(/\b\w/g, (char) => char.toUpperCase())
.replace(/\s+/g, '')}`;
}

// Function to check if the spec has a specific tag and
// if the status is skipped
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/menu-buttons/accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ custom component.
- When the combo button menu is open, the element (`div`) wrapping the entire
combo button is given `aria-owns` with a value of the menu `id`.

<A11yStatus layout="table" components="Menu buttons" />
<A11yStatus layout="table" components={["Menu buttons", "Combo button", "Overflow menu"]}/>

0 comments on commit 9128f40

Please sign in to comment.