Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "ChoiceGroup: Flex layout for icon and image fields. Fixed some image field bugs.",
"type": "minor"
}
],
"packageName": "office-ui-fabric-react",
"email": "lynam.emily@gmail.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ $ms-choiceField-transition-timing: cubic-bezier(.4, 0, .23, 1);
display: block;
}

.optionsContainIconOrImage {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

.choiceField {
display: flex;
align-items: center;
Expand Down Expand Up @@ -194,14 +200,15 @@ $ms-choiceField-transition-timing: cubic-bezier(.4, 0, .23, 1);
@include ms-margin(0, 4px, 4px, 0);
@include ms-padding-left(0px);
@include ms-bgColor-neutralLighter;
height: 100%;

$radioButtonSpacing: 3px;
$radioButtonInnerSize: 5px;

.fieldIsImage, .fieldIsIcon {

display: inline-block;
box-sizing: border-box;
box-sizing: content-box;
cursor: pointer;
padding-top: 22px;
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ export class ChoiceGroup extends BaseComponent<IChoiceGroupProps, IChoiceGroupSt
{ this.props.label && (
<Label className={ className } required={ required } id={ this._id + '-label' }>{ label }</Label>
) }
<div
className={ css('ms-ChoiceFieldGroup-flexContainer', options!.some(
option => Boolean(option.iconProps || option.imageSrc)
) && styles.optionsContainIconOrImage) }
>

{ options!.map((option: IChoiceGroupOption) => {
const {
Expand Down Expand Up @@ -125,6 +130,7 @@ export class ChoiceGroup extends BaseComponent<IChoiceGroupProps, IChoiceGroupSt
</div>
);
}) }
</div>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,100 +11,104 @@ exports[`ChoiceGroup renders ChoiceGroup correctly 1`] = `
role="radiogroup"
>
<div
className="ms-ChoiceField"
className="ms-ChoiceFieldGroup-flexContainer"
>
<div
className="ms-ChoiceField-wrapper"
className="ms-ChoiceField"
>
<input
aria-labelledby="ChoiceGroup0-1"
checked={false}
className="ms-ChoiceField-input"
data-automation-id="auto1"
disabled={undefined}
id="ChoiceGroup0-1"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-1"
<div
className="ms-ChoiceField-wrapper"
>
<span
className="ms-Label"
id="ChoiceGroupLabel1-1"
<input
aria-labelledby="ChoiceGroup0-1"
checked={false}
className="ms-ChoiceField-input"
data-automation-id="auto1"
disabled={undefined}
id="ChoiceGroup0-1"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-1"
>
1
</span>
</label>
<span
className="ms-Label"
id="ChoiceGroupLabel1-1"
>
1
</span>
</label>
</div>
</div>
</div>
<div
className="ms-ChoiceField"
>
<div
className="ms-ChoiceField-wrapper"
className="ms-ChoiceField"
>
<input
aria-labelledby="ChoiceGroup0-2"
checked={false}
className="ms-ChoiceField-input"
disabled={undefined}
id="ChoiceGroup0-2"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-2"
<div
className="ms-ChoiceField-wrapper"
>
<span
className="ms-Label"
id="ChoiceGroupLabel1-2"
<input
aria-labelledby="ChoiceGroup0-2"
checked={false}
className="ms-ChoiceField-input"
disabled={undefined}
id="ChoiceGroup0-2"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-2"
>
2
</span>
</label>
<span
className="ms-Label"
id="ChoiceGroupLabel1-2"
>
2
</span>
</label>
</div>
</div>
</div>
<div
className="ms-ChoiceField"
>
<div
className="ms-ChoiceField-wrapper"
className="ms-ChoiceField"
>
<input
aria-labelledby="ChoiceGroup0-3"
checked={false}
className="ms-ChoiceField-input"
disabled={undefined}
id="ChoiceGroup0-3"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-3"
<div
className="ms-ChoiceField-wrapper"
>
<span
className="ms-Label"
id="ChoiceGroupLabel1-3"
<input
aria-labelledby="ChoiceGroup0-3"
checked={false}
className="ms-ChoiceField-input"
disabled={undefined}
id="ChoiceGroup0-3"
name="ChoiceGroup0"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
required={true}
type="radio"
/>
<label
className="ms-ChoiceField-field"
htmlFor="ChoiceGroup0-3"
>
3
</span>
</label>
<span
className="ms-Label"
id="ChoiceGroupLabel1-3"
>
3
</span>
</label>
</div>
</div>
</div>
</div>
Expand Down