diff --git a/ionic/components/checkbox/test/basic/e2e.ts b/ionic/components/checkbox/test/basic/e2e.ts index 6616981f96..3e340014f6 100644 --- a/ionic/components/checkbox/test/basic/e2e.ts +++ b/ionic/components/checkbox/test/basic/e2e.ts @@ -1,3 +1,4 @@ + it('should toggle checkbox state with label click', function() { element(by.css('#appleLabel')).click(); }); diff --git a/ionic/components/radio/extensions/ios.scss b/ionic/components/radio/extensions/ios.scss index 3192becbc1..85f9b69b67 100644 --- a/ionic/components/radio/extensions/ios.scss +++ b/ionic/components/radio/extensions/ios.scss @@ -2,13 +2,40 @@ // iOS Radio // -------------------------------------------------- -$radio-ios-color: #007aff; +$radio-ios-foreground-color: get-color(primary, base) !default; -.radio-group[mode="ios"] { +.radio[mode="ios"] { - .media-radio { - color: $radio-ios-color; + .radio-icon { + position: relative; + width: 16px; + height: 21px; + } + + &[aria-checked=true] .radio-icon { + border-color: $radio-ios-foreground-color; + + &::after { + position: absolute; + border: 2px solid $radio-ios-foreground-color; + top: 3px; + left: 7px; + width: 4px; + height: 10px; + border-left: none; + border-top: none; + content: ''; + transform: rotate(45deg); + } + } + + &[aria-checked=true] { + color: $radio-ios-foreground-color; + } + + .input-label { + color: inherit; } } diff --git a/ionic/components/radio/radio.scss b/ionic/components/radio/radio.scss index 57f303ddca..bdca6570ac 100644 --- a/ionic/components/radio/radio.scss +++ b/ionic/components/radio/radio.scss @@ -2,49 +2,28 @@ // Radio // -------------------------------------------------- -$radio-padding: 0 15px !default; - - -.radio .item-media { - padding: $radio-padding; +.radio { + position: relative; + cursor: pointer; + @include user-select-none(); } .radio input { - position: relative; - left: -9999px; + position: absolute; + width: 0; + height: 0; + margin: 0; + padding: 0; + opacity: 0; + border: none; + @include appearance(none); } -.radio-on { - display: none; -} - -.radio-off { - display: block; -} - -.radio[aria-checked=true] { - - .radio-on { - display: block; - } - - .radio-off { - display: none; - } - +.radio .input-label { + max-width: 100%; } .radio[aria-disabled=true] { - pointer-events: none; opacity: 0.5; color: gray; - - .media-radio { - color: inherit; - } } - -// .radio .item-media, -// .radio .item-content { -// pointer-events: none; -// } diff --git a/ionic/components/radio/radio.ts b/ionic/components/radio/radio.ts index e22a149f20..e5777d51c7 100644 --- a/ionic/components/radio/radio.ts +++ b/ionic/components/radio/radio.ts @@ -10,7 +10,7 @@ let groupName = -1; @IonicDirective({ selector: 'ion-radio-group', host: { - '[class.list]': 'list' + 'class': 'list' } }) export class RadioGroup extends Ion { @@ -33,7 +33,6 @@ export class RadioGroup extends Ion { cd.valueAccessor = this; this.value = ""; - this.list = true; } registerButton(radioButton) { @@ -73,22 +72,16 @@ export class RadioGroup extends Ion { selector: 'ion-radio', host: { '[class.item]': 'item', - '[class.active]': 'input.checked', '[attr.aria-checked]': 'input.checked', - }, - defaultProperties: { - 'iconOff': 'ion-ios-circle-outline', - 'iconOn': 'ion-ios-checkmark' } }) @IonicView({ template: - '
' + - '' + - '' + - '
' + '
' + '' + + '
' + + '
' + + '
' + '
' }) export class RadioButton extends IonInputItem { diff --git a/ionic/components/radio/test/basic/e2e.ts b/ionic/components/radio/test/basic/e2e.ts new file mode 100644 index 0000000000..a259ec5d31 --- /dev/null +++ b/ionic/components/radio/test/basic/e2e.ts @@ -0,0 +1,8 @@ + +it('should check Banana', function() { + element(by.css('#e2eBanana')).click(); +}); + +it('should check Cherry', function() { + element(by.css('#e2eSelectCherry')).click(); +}); diff --git a/ionic/components/radio/test/basic/main.html b/ionic/components/radio/test/basic/main.html index adcbcd26e6..d818bc0215 100644 --- a/ionic/components/radio/test/basic/main.html +++ b/ionic/components/radio/test/basic/main.html @@ -1,24 +1,43 @@ - +Radio Group - -
+ + + + + +
Fruits
- - - - - + + + + - fruits.dirty: {{fruitsForm.controls.fruits.dirty}}
- fruits.value: {{fruitsForm.controls.fruits.value}}
- - - - -
-
+ + + + + + + + + + + + +

+ fruits.dirty: {{fruitsForm.controls.fruits.dirty}}
+ fruits.value: {{fruitsForm.controls.fruits.value}}
+

+ + + + + + + +