Skip to content

Commit

Permalink
Prevent Ink from altering the accessibility tree
Browse files Browse the repository at this point in the history
When rendered inside a `<button>`, canvas element produces an unintended side-effect in Chrome, changing the announced role of the button to "button, group". Adding `aria-hidden="true"` effectively hides the canvas element from assistive software such as screen readers, so the role of the button is correctly announced as just "button".
  • Loading branch information
Chudesnov authored Sep 13, 2022
1 parent a50242c commit 9cf8877
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default class Ink extends React.PureComponent {

let props = merge(
{
"aria-hidden": true,
className: className,
ref: this.setCanvas.bind(this),
height: height * density,
Expand Down

0 comments on commit 9cf8877

Please sign in to comment.