Skip to content

Commit b71d7b4

Browse files
authored
Merge branch 'master' into pill
2 parents 0470716 + cbba099 commit b71d7b4

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

src/radio/radio-group.component.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ export class RadioChange {
6464
*/
6565
@Component({
6666
selector: "ibm-radio-group",
67-
template: `<ng-content></ng-content>`,
67+
template: `
68+
<div class="bx--radio-button-group" role="radiogroup">
69+
<ng-content></ng-content>
70+
</div>
71+
`,
6872
providers: [
6973
{
7074
provide: NG_VALUE_ACCESSOR,
@@ -180,14 +184,9 @@ export class RadioGroup implements OnInit, AfterContentInit, ControlValueAccesso
180184
}
181185

182186
/**
183-
* Binds 'radiogroup' value to the role attribute for `RadioGroup`.
187+
* Binds 'bx--form-item' value to the class for `RadioGroup`.
184188
*/
185-
@HostBinding("attr.role") role = "radiogroup";
186-
187-
/**
188-
* Binds 'bx--radio-button-group' value to the class for `RadioGroup`.
189-
*/
190-
@HostBinding("class.bx--radio-button-group") radioButtonGroupClass = true;
189+
@HostBinding("class.bx--form-item") radioButtonGroupClass = true;
191190

192191
/**
193192
* To track whether the `RadioGroup` has been initialized.

src/radio/radio.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ export class Radio extends Checkbox implements OnInit {
117117
*/
118118
@HostBinding("attr.role") role = "radio";
119119

120+
@HostBinding("class.bx--checkbox-wrapper") get checkboxWrapperClass() {
121+
return false;
122+
}
123+
@HostBinding("class.bx--form-item") get formItemClass() {
124+
return false;
125+
}
126+
120127
/**
121128
* The id for the `Radio`.
122129
* @type {string}

src/radio/radio.stories.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ storiesOf("Radio", module).addDecorator(
1515
<ibm-radio-group aria-label="radiogroup" [(ngModel)]="radio" (change)="onChange($event)">
1616
<ibm-radio *ngFor="let radio of manyRadios"
1717
[value]="radio.num"
18-
[disabled]="radio.disabled">{{radio.num}}
18+
[disabled]="radio.disabled">
19+
{{radio.num}}
1920
</ibm-radio>
2021
</ibm-radio-group>
2122
`,
2223
props: {
2324
onChange: action("Radio change"),
2425
manyRadios: [
25-
{ num: "one", disabled: false },
26+
{ num: "one" },
2627
{ num: "two" },
2728
{ num: "three" },
28-
{ num: "four" }
29+
{ num: "four", disabled: true }
2930
]
3031
}
3132
}))

0 commit comments

Comments
 (0)