1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-19 05:22:13 +03:00

improve Settings Accessibility for Toggles and Dialogs

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2019-09-25 09:25:11 +01:00
parent 4a5ee4a969
commit e01be212e6
5 changed files with 13 additions and 5 deletions

View File

@@ -58,6 +58,9 @@ export default class ToggleSwitch extends React.Component {
};
render() {
// eslint-disable-next-line no-unused-vars
const {checked, disabled, onChange, ...props} = this.props;
const classes = classNames({
"mx_ToggleSwitch": true,
"mx_ToggleSwitch_on": this.state.checked,
@@ -65,11 +68,13 @@ export default class ToggleSwitch extends React.Component {
});
return (
<div
{...props}
className={classes}
onClick={this._onClick}
role="checkbox"
aria-checked={this.state.checked}
aria-disabled={this.props.disabled}>
aria-disabled={disabled}
tabIndex={0}>
<div className="mx_ToggleSwitch_ball" />
</div>
);