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

Show "none" as an alignment option and use contextual text to clarify settings #34710

Merged
merged 12 commits into from
Sep 24, 2021
Prev Previous commit
Next Next commit
update snapshots
ntsekouras committed Sep 23, 2021
commit f9250cf5efaa1688c25a8f3120f65f9ce4d41214
Original file line number Diff line number Diff line change
@@ -4,6 +4,20 @@ exports[`BlockAlignmentUI should match snapshot 1`] = `
<ToolbarGroup
controls={
Array [
Object {
"icon": <SVG
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<Path
d="M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"
/>
</SVG>,
"isActive": false,
"onClick": [Function],
"role": "menuitemradio",
"title": "None",
},
Object {
"icon": <SVG
viewBox="0 0 24 24"
@@ -24,7 +38,7 @@ exports[`BlockAlignmentUI should match snapshot 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
<Path
d="M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"
d="M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"
/>
</SVG>,
"isActive": false,
2 changes: 1 addition & 1 deletion packages/components/src/menu-item/index.js
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ export function MenuItem( props, ref ) {
: undefined
}
role={ role }
icon={ iconPosition === 'left' && icon }
icon={ iconPosition === 'left' ? icon : undefined }
className={ className }
{ ...buttonProps }
>
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ exports[`MenuItem should match snapshot when all props provided 1`] = `
<Icon
icon={
<SVG
className="components-menu-items__item-icon"
className="components-menu-items__item-icon has-icon-right"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
@@ -79,7 +79,7 @@ exports[`MenuItem should match snapshot when isSelected and role are optionally
<Icon
icon={
<SVG
className="components-menu-items__item-icon"
className="components-menu-items__item-icon has-icon-right"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>