1
0
mirror of https://github.com/flarum/core.git synced 2025-07-26 03:01:22 +02:00

[A11Y] Make checkboxes focusable (#3014)

* Add extra feature to a11y focusring mixin

* Add visually hidden CSS class and mixin

* Visually hide checkboxes (keep in focus/a11y tree)

* Place checkbox focus ring around display element

* Improve mobile checkbox/switch accessibility
This commit is contained in:
David Wheatley
2021-08-16 11:56:10 +02:00
committed by GitHub
parent 912d2981c1
commit 37a1383c2f
4 changed files with 75 additions and 7 deletions

View File

@@ -33,7 +33,9 @@ export default class Checkbox extends Component {
return (
<label className={className}>
<input type="checkbox" checked={this.attrs.state} disabled={this.attrs.disabled} onchange={withAttr('checked', this.onchange.bind(this))} />
<div className="Checkbox-display">{this.getDisplay()}</div>
<div className="Checkbox-display" aria-hidden="true">
{this.getDisplay()}
</div>
{vnode.children}
</label>
);