fix(radio/checkbox/toggle): fix the tab index attribute so you can tab to them

references #745
This commit is contained in:
Brandy Carney
2015-12-18 13:15:38 -05:00
parent 8b35fae3bd
commit 80b2579609
3 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,7 @@ import {Form} from '../../util/form';
'role': 'checkbox',
'tappable': 'true',
'[attr.id]': 'id',
'[attr.tab-index]': 'tabIndex',
'[tabindex]': 'tabIndex',
'[attr.aria-checked]': 'checked',
'[attr.aria-disabled]': 'disabled',
'[attr.aria-labelledby]': 'labelId',
@ -64,6 +64,7 @@ export class Checkbox {
this.onChange = (_) => {};
this.onTouched = (_) => {};
this.tabIndex = 0;
this.ngControl = ngControl;
if (ngControl) ngControl.valueAccessor = this;

View File

@ -180,7 +180,7 @@ export class RadioGroup extends Ion {
'role': 'radio',
'tappable': 'true',
'[attr.id]': 'id',
'[attr.tab-index]': 'tabIndex',
'[tabindex]': 'tabIndex',
'[attr.aria-checked]': 'checked',
'[attr.aria-disabled]': 'disabled',
'[attr.aria-labelledby]': 'labelId',

View File

@ -83,7 +83,7 @@ class MediaToggle {
'role': 'checkbox',
'tappable': 'true',
'[attr.id]': 'id',
'[attr.tab-index]': 'tabIndex',
'[tabindex]': 'tabIndex',
'[attr.aria-checked]': 'checked',
'[attr.aria-disabled]': 'disabled',
'[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');
}
this.tabIndex = 0;
this.form = form;
form.register(this);