Skip to content

Commit

Permalink
[WNMGDS-2750] Remove aria-disabled from TabPanel components (#3315)
Browse files Browse the repository at this point in the history
* Remove aria-disabled attribute

* Updates a unit test for a disabled tabPanel.
  • Loading branch information
tamara-corbalt authored Nov 14, 2024
1 parent 2f157e9 commit 922fffc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/design-system/src/components/Tabs/TabPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ describe('TabPanel', () => {
expect(tabPanelEl).toBeDefined();
expect(tabPanelEl.getAttribute('aria-labelledby')).toBe(defaultProps.tabId);
expect(tabPanelEl.getAttribute('aria-hidden')).toBe('false');
expect(tabPanelEl.getAttribute('aria-disabled')).toBe(null);
});

it('adds additional class names', () => {
Expand All @@ -42,9 +41,9 @@ describe('TabPanel', () => {
expect(tabPanelEl.classList).toContain('ds-c-tabs__panel');
});

it('sets aria-disabled', () => {
it('sets aria-hidden="true" if tabPanel is disabled', () => {
renderTabPanel({ disabled: true });
const tabPanelEl = screen.getByRole('tabpanel', { hidden: true });
expect(tabPanelEl.getAttribute('aria-disabled')).toBe('true');
expect(tabPanelEl).toHaveAttribute('aria-hidden', 'true');
});
});
1 change: 0 additions & 1 deletion packages/design-system/src/components/Tabs/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const TabPanel = (props: TabPanelProps) => {
<div
aria-labelledby={props.tabId}
aria-hidden={!props.selected}
aria-disabled={props.disabled}
className={classes}
id={props.id}
role="tabpanel"
Expand Down

0 comments on commit 922fffc

Please sign in to comment.