Merge pull request #3707 from matrix-org/t3chguy/improve_a11y_reactions_row_button

Switch ReactionsRowButton to an AccessibleButton for space/enter handling
This commit is contained in:
Michael Telatynski 2019-12-09 13:43:06 +00:00 committed by GitHub
commit 21647cf596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,10 +126,9 @@ export default class ReactionsRowButton extends React.PureComponent {
);
}
return <span className={classes}
role="button"
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
return <AccessibleButton className={classes}
aria-label={label}
tabindex="0"
onClick={this.onClick}
onMouseOver={this.onMouseOver}
onMouseOut={this.onMouseOut}
@ -141,6 +140,6 @@ export default class ReactionsRowButton extends React.PureComponent {
{count}
</span>
{tooltip}
</span>;
</AccessibleButton>;
}
}