Adds aria labels to all input ui (#1136)

* adds aria-label to inputs for connection

* formatting

* add ariaLabels to all checkboxes/inputboxes/dropdowns
This commit is contained in:
Anthony Dresser
2018-04-13 12:09:25 -07:00
committed by GitHub
parent 13fb9fdfd2
commit f739c47984
13 changed files with 97 additions and 37 deletions

View File

@@ -12,6 +12,7 @@ export interface ICheckboxOptions {
enabled?: boolean;
checked?: boolean;
onChange?: (val: boolean) => void;
ariaLabel?: string;
}
export class Checkbox extends Widget {
@@ -27,6 +28,10 @@ export class Checkbox extends Widget {
this._el = document.createElement('input');
this._el.type = 'checkbox';
if (opts.ariaLabel) {
this._el.setAttribute('aria-label', opts.ariaLabel);
}
this.onchange(this._el, e => {
this._onChange.fire(this.checked);
});