fix(aria): aria label/id updates

This commit is contained in:
Adam Bradley
2015-12-14 21:34:40 -06:00
parent 2a32711857
commit 7c8c56ee3e
7 changed files with 72 additions and 101 deletions

View File

@@ -82,6 +82,7 @@ class MediaToggle {
host: {
'role': 'checkbox',
'tappable': 'true',
'[attr.id]': 'id',
'[attr.tab-index]': 'tabIndex',
'[attr.aria-checked]': 'checked',
'[attr.aria-disabled]': 'disabled',
@@ -169,7 +170,11 @@ export class Toggle {
* @private
*/
ngOnInit() {
this.labelId = 'label-' + this.inputId;
if (!this.id) {
this.id = 'tgl-' + this.form.nextId();
}
this.labelId = 'lbl-' + this.id;
}
/**
@@ -260,4 +265,11 @@ export class Toggle {
isDisabled(ev) {
return (this.lastTouch + 999 > Date.now() && /mouse/.test(ev.type)) || (this.mode == 'ios' && ev.target.tagName == 'ION-TOGGLE');
}
/**
* @private
*/
initFocus() {
}
}