From fc2b2a956e5175ab7fffe57a9f4d07f30137086d Mon Sep 17 00:00:00 2001 From: DAK <40970507+dakahn@users.noreply.github.com> Date: Thu, 5 Mar 2020 18:08:53 -0600 Subject: [PATCH] fix(button): remove role="button" from button styled anchors (#5522) * fix(Dropdown): rely on list-box height closes #4916 * fix(button): add aria label to non button element button * test(button): add a test checking that button's get an aria-label * fix(button): undo previous changes; remove role=button for anchor * test(button): remove unneeded test for role Co-authored-by: TJ Egan Co-authored-by: Josh Black --- packages/react/src/components/Button/Button-test.js | 4 ---- packages/react/src/components/Button/Button.js | 1 - 2 files changed, 5 deletions(-) diff --git a/packages/react/src/components/Button/Button-test.js b/packages/react/src/components/Button/Button-test.js index 5dd661907b46..f2f8b00e7798 100644 --- a/packages/react/src/components/Button/Button-test.js +++ b/packages/react/src/components/Button/Button-test.js @@ -95,10 +95,6 @@ describe('Button', () => { it('renders as an element with an href', () => { expect(wrapper.is('a')).toBe(true); }); - - it('should always render with [role="button"] by default', () => { - expect(wrapper.props().role).toEqual('button'); - }); }); describe('Renders arbitrary component with correct props', () => { diff --git a/packages/react/src/components/Button/Button.js b/packages/react/src/components/Button/Button.js index 35ad6a797d5f..b41876adca62 100644 --- a/packages/react/src/components/Button/Button.js +++ b/packages/react/src/components/Button/Button.js @@ -68,7 +68,6 @@ const Button = React.forwardRef(function Button( type, }; const anchorProps = { - role: 'button', href, }; const assistiveText = hasIconOnly ? (