Skip to content

Commit

Permalink
fix(ionRadio): fix adjacent selectors that break in iOS9
Browse files Browse the repository at this point in the history
Closes #4347
  • Loading branch information
mhartington committed Sep 11, 2015
1 parent 2449c48 commit 11232d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 4 additions & 2 deletions js/angular/directive/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ IonicModule
template:
'<label class="item item-radio">' +
'<input type="radio" name="radio-group">' +
'<div class="item-content disable-pointer-events" ng-transclude></div>' +
'<i class="radio-icon disable-pointer-events icon ion-checkmark"></i>' +
'<div class="radio-content">'+
'<div class="item-content disable-pointer-events" ng-transclude></div>' +
'<i class="radio-icon disable-pointer-events icon ion-checkmark"></i>' +
'</div>'+
'</label>',

compile: function(element, attr) {
Expand Down
14 changes: 2 additions & 12 deletions scss/_radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,14 @@
position: absolute;
left: -9999px;

&:checked ~ .item-content {
&:checked + .radio-content .item-content {
/* style the item content when its checked */
background: #f7f7f7;
}

&:checked ~ .radio-icon {

This comment has been minimized.

Copy link
@geo242

geo242 Oct 31, 2015

This change invalidates the demo here: http://ionicframework.com/docs/components/#radio-buttons

The item-content and radio-icon elements now need to be wrapped with a class of radio-content.

Any idea when the demo page will be updated to reflect this?

This comment has been minimized.

Copy link
@mhartington

mhartington Oct 31, 2015

Author Contributor

I'll update it in the morning

&:checked + .radio-content .radio-icon {
/* show the checkmark icon when its checked */
visibility: visible;
}
}

// Hack for Android to correctly display the checked item
// http://timpietrusky.com/advanced-checkbox-hack
.platform-android.grade-b .item-radio,
.platform-android.grade-c .item-radio {
-webkit-animation: androidCheckedbugfix infinite 1s;
}
@-webkit-keyframes androidCheckedbugfix {
from { padding: 0; }
to { padding: 0; }
}

1 comment on commit 11232d4

@joelbrewer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to leave a comment here saying the documentation on the demo page still doesn't reflect this change. Would love to contribute to Ionic.. how would I go about updating those docs?

Please sign in to comment.