mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(aria): aria label/id updates
This commit is contained in:
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user