Skip to content

Commit 91d6f52

Browse files
author
Ben Grynhaus
committed
[Fabric] when rendering a custom icon in command bar the icon is now in the proper location
1 parent 33f9e6c commit 91d6f52

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/fabric/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "../../node_modules/ng-packagr/package.schema.json",
33
"name": "@angular-react/fabric",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"ngPackage": {
66
"lib": {
77
"entryFile": "public-api.ts",
@@ -62,7 +62,7 @@
6262
],
6363
"private": false,
6464
"peerDependencies": {
65-
"@angular-react/core": "^0.2.3",
65+
"@angular-react/core": "^0.2.4",
6666
"@angular/common": "^5.2.7",
6767
"@angular/core": "^5.2.7",
6868
"@angular/platform-browser-dynamic": "^5.2.7",

libs/fabric/src/components/command-bar/command-bar.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ export class FabCommandBarComponent extends ReactWrapperComponent<ICommandBarPro
189189
private _transformCommandBarItemOptionsToProps(itemOptions: ICommandBarItemOptions): ICommandBarItemProps {
190190
const sharedProperties = omit(itemOptions, 'renderIcon', 'render');
191191

192-
const iconRenderer = this.createInputJsxRenderer(itemOptions.renderIcon);
192+
// Legacy render mode is used for the icon because otherwise the icon is to the right of the text (instead of the usual left)
193+
const iconRenderer = this.createInputJsxRenderer(itemOptions.renderIcon, { legacyRenderMode: true });
193194
const renderer = this.createInputJsxRenderer(itemOptions.render);
194195

195196
return Object.assign(

0 commit comments

Comments
 (0)