From 563dd8d521bfd5583061eea5a10b883bb4ea00c1 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 6 Aug 2015 12:46:45 -0500 Subject: [PATCH] no input element in checkbox --- ionic/components/checkbox/checkbox.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) 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)