From 80b2579609eb552e279cee453de5bd84d7c96a20 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 18 Dec 2015 13:15:38 -0500 Subject: [PATCH] fix(radio/checkbox/toggle): fix the tab index attribute so you can tab to them references #745 --- ionic/components/checkbox/checkbox.ts | 3 ++- ionic/components/radio/radio.ts | 2 +- ionic/components/toggle/toggle.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ionic/components/checkbox/checkbox.ts b/ionic/components/checkbox/checkbox.ts index 6e99e700d2..46f03486b6 100644 --- a/ionic/components/checkbox/checkbox.ts +++ b/ionic/components/checkbox/checkbox.ts @@ -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; diff --git a/ionic/components/radio/radio.ts b/ionic/components/radio/radio.ts index 58c29c1ab2..808caa9ca7 100644 --- a/ionic/components/radio/radio.ts +++ b/ionic/components/radio/radio.ts @@ -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', diff --git a/ionic/components/toggle/toggle.ts b/ionic/components/toggle/toggle.ts index a67437a05d..900b4731ad 100644 --- a/ionic/components/toggle/toggle.ts +++ b/ionic/components/toggle/toggle.ts @@ -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(' has been renamed to , please update your HTML'); } + this.tabIndex = 0; this.form = form; form.register(this);