Skip to content

Commit

Permalink
fix(button): remove role="button" from button styled anchors (#5522)
Browse files Browse the repository at this point in the history
* 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 <a> 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 <[email protected]>
Co-authored-by: Josh Black <[email protected]>
  • Loading branch information
3 people authored Mar 6, 2020
1 parent 58f262b commit fc2b2a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
4 changes: 0 additions & 4 deletions packages/react/src/components/Button/Button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ describe('Button', () => {
it('renders as an <a> 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', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const Button = React.forwardRef(function Button(
type,
};
const anchorProps = {
role: 'button',
href,
};
const assistiveText = hasIconOnly ? (
Expand Down

0 comments on commit fc2b2a9

Please sign in to comment.