mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(radio/checkbox/toggle): fix the tab index attribute so you can tab to them
references #745
This commit is contained in:
@ -34,7 +34,7 @@ import {Form} from '../../util/form';
|
|||||||
'role': 'checkbox',
|
'role': 'checkbox',
|
||||||
'tappable': 'true',
|
'tappable': 'true',
|
||||||
'[attr.id]': 'id',
|
'[attr.id]': 'id',
|
||||||
'[attr.tab-index]': 'tabIndex',
|
'[tabindex]': 'tabIndex',
|
||||||
'[attr.aria-checked]': 'checked',
|
'[attr.aria-checked]': 'checked',
|
||||||
'[attr.aria-disabled]': 'disabled',
|
'[attr.aria-disabled]': 'disabled',
|
||||||
'[attr.aria-labelledby]': 'labelId',
|
'[attr.aria-labelledby]': 'labelId',
|
||||||
@ -64,6 +64,7 @@ export class Checkbox {
|
|||||||
this.onChange = (_) => {};
|
this.onChange = (_) => {};
|
||||||
this.onTouched = (_) => {};
|
this.onTouched = (_) => {};
|
||||||
|
|
||||||
|
this.tabIndex = 0;
|
||||||
this.ngControl = ngControl;
|
this.ngControl = ngControl;
|
||||||
|
|
||||||
if (ngControl) ngControl.valueAccessor = this;
|
if (ngControl) ngControl.valueAccessor = this;
|
||||||
|
@ -180,7 +180,7 @@ export class RadioGroup extends Ion {
|
|||||||
'role': 'radio',
|
'role': 'radio',
|
||||||
'tappable': 'true',
|
'tappable': 'true',
|
||||||
'[attr.id]': 'id',
|
'[attr.id]': 'id',
|
||||||
'[attr.tab-index]': 'tabIndex',
|
'[tabindex]': 'tabIndex',
|
||||||
'[attr.aria-checked]': 'checked',
|
'[attr.aria-checked]': 'checked',
|
||||||
'[attr.aria-disabled]': 'disabled',
|
'[attr.aria-disabled]': 'disabled',
|
||||||
'[attr.aria-labelledby]': 'labelId',
|
'[attr.aria-labelledby]': 'labelId',
|
||||||
|
@ -83,7 +83,7 @@ class MediaToggle {
|
|||||||
'role': 'checkbox',
|
'role': 'checkbox',
|
||||||
'tappable': 'true',
|
'tappable': 'true',
|
||||||
'[attr.id]': 'id',
|
'[attr.id]': 'id',
|
||||||
'[attr.tab-index]': 'tabIndex',
|
'[tabindex]': 'tabIndex',
|
||||||
'[attr.aria-checked]': 'checked',
|
'[attr.aria-checked]': 'checked',
|
||||||
'[attr.aria-disabled]': 'disabled',
|
'[attr.aria-disabled]': 'disabled',
|
||||||
'[attr.aria-labelledby]': 'labelId',
|
'[attr.aria-labelledby]': 'labelId',
|
||||||
@ -118,6 +118,7 @@ export class Toggle {
|
|||||||
console.warn('<ion-switch> has been renamed to <ion-toggle>, please update your HTML');
|
console.warn('<ion-switch> has been renamed to <ion-toggle>, please update your HTML');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.tabIndex = 0;
|
||||||
|
|
||||||
this.form = form;
|
this.form = form;
|
||||||
form.register(this);
|
form.register(this);
|
||||||
|
Reference in New Issue
Block a user