Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ChoiceGroup): add better guidance for image + text strings, and update the example #19758

Merged
merged 3 commits into from
Sep 10, 2021
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
Expand Up @@ -6,17 +6,18 @@ const options: IChoiceGroupOption[] = [
{
key: 'bar',
imageSrc: TestImages.choiceGroupBarUnselected,
imageAlt: 'Bar chart icon',
imageAlt: 'Bar chart',
selectedImageSrc: TestImages.choiceGroupBarSelected,
imageSize: { width: 32, height: 32 },
text: 'Clustered bar chart', // This text is long to show text wrapping.
text: 'Bar',
},
{
key: 'pie',
imageSrc: TestImages.choiceGroupBarUnselected,
selectedImageSrc: TestImages.choiceGroupBarSelected,
imageSrc: TestImages.choiceGroupPieUnselected,
imageAlt: 'Pie chart',
selectedImageSrc: TestImages.choiceGroupPieSelected,
imageSize: { width: 32, height: 32 },
text: 'Pie chart',
text: 'Pie',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
- Select the safest (to prevent loss of data or system access), most secure, and most private option as the default. If safety and security aren't factors, select the most likely or convenient option.
- Use a phrase for the label, rather than a full sentence.
- Make sure to give people the option to not make a choice. For example, include a "None" option.
- When using ChoiceGroup with images, keep text short (ideally one or two words), since overflowing text will be cut off. Translation to other languages and user-applied text styles can often cause label text to end up longer than the English label with author styles.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
>
<img
alt="Bar chart icon"
alt="Bar chart"
className=
ms-Image-image
ms-Image-image--portrait
Expand Down Expand Up @@ -319,7 +319,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
>
<img
alt="Bar chart icon"
alt="Bar chart"
className=
ms-Image-image
ms-Image-image--portrait
Expand Down Expand Up @@ -364,7 +364,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
className="ms-ChoiceFieldLabel"
id="ChoiceGroupLabel1-bar"
>
Clustered bar chart
Bar
</span>
</div>
</label>
Expand Down Expand Up @@ -552,7 +552,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
>
<img
alt=""
alt="Pie chart"
className=
ms-Image-image
ms-Image-image--portrait
Expand All @@ -566,7 +566,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
onError={[Function]}
onLoad={[Function]}
src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-react-assets/choicegroup-bar-unselected.png"
src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-react-assets/choicegroup-pie-unselected.png"
/>
</div>
</div>
Expand Down Expand Up @@ -611,7 +611,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
>
<img
alt=""
alt="Pie chart"
className=
ms-Image-image
ms-Image-image--portrait
Expand All @@ -625,7 +625,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
}
onError={[Function]}
onLoad={[Function]}
src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-react-assets/choicegroup-bar-selected.png"
src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-react-assets/choicegroup-pie-selected.png"
/>
</div>
</div>
Expand Down Expand Up @@ -656,7 +656,7 @@ exports[`Component Examples renders ChoiceGroup.Image.Example.tsx correctly 1`]
className="ms-ChoiceFieldLabel"
id="ChoiceGroupLabel1-pie"
>
Pie chart
Pie
</span>
</div>
</label>
Expand Down