Skip to content

[ButtonBase] Improve Button accessibilityΒ #15512

@bluSCALE4

Description

@bluSCALE4

Revert #10339 removed safeguard and add additional one so anchors missing href's are treated as buttons.

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior πŸ€”

An anchor with an href should not be assigned role=button.

Current Behavior 😯

An anchor with prop button w/ href is being given role of button as it misleads users. A button does not alter the url path while an href does.

Steps to Reproduce πŸ•Ή

<ListItem component={Link} to={path} button>
Hi there
</ListItem>

Context πŸ”¦

Screen reader

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions