diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts
index 7dffa356c5..c3a21e1dbd 100644
--- a/ionic/components/checkbox/checkbox.ts
+++ b/ionic/components/checkbox/checkbox.ts
@@ -23,8 +23,9 @@ import {TapClick} from '../button/button';
host: {
'class': 'item',
'role': 'checkbox',
- '[attr.aria-checked]': 'input.checked',
- '[attr.aria-disabled]': 'input.disabled',
+ '[attr.tab-index]': 'tabIndex',
+ '[attr.aria-checked]': 'checked',
+ '[attr.aria-disabled]': 'disabled',
'[attr.aria-labelledby]': 'labelId',
'(^click)': 'click($event)'
},
@@ -33,7 +34,6 @@ import {TapClick} from '../button/button';
@IonicView({
template:
'
' +
'' +
@@ -49,6 +49,7 @@ export class Checkbox extends IonInputItem {
) {
super(elementRef, config);
this.tapClick = tapClick;
+ this.tabIndex = 0;
this.onChange = (_) => {};
this.onTouched = (_) => {};
@@ -63,14 +64,8 @@ export class Checkbox extends IonInputItem {
this.labelId = 'label-' + this.id;
}
- onAllChangesDone() {
- this.input.checked = this.checked;
- this.input.disabled = this.disabled;
- this.input.value = this.value;
- }
-
toggle() {
- this.input.checked = this.checked = !this.input.checked;
+ this.checked = !this.checked;
this.onChange(this.checked);
}
@@ -82,9 +77,8 @@ export class Checkbox extends IonInputItem {
}
}
- // Called by the model (Control) to update the view
writeValue(modelValue) {
- this.input.checked = modelValue;
+ this.checked = modelValue;
}
// Used by the view to update the model (Control)