Skip to content

Commit a4f502b

Browse files
authored
fix(ui5-shellbar): check for profile correctly (#1438)
1 parent 28cc988 commit a4f502b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/fiori/src/ShellBar.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ class ShellBar extends UI5Element {
520520
const newItems = this._getAllItems(hasIcons).map(info => {
521521
const isOverflowIcon = info.classes.indexOf("ui5-shellbar-overflow-button") !== -1;
522522
const isImageIcon = info.classes.indexOf("ui5-shellbar-image-button") !== -1;
523-
const shouldStayOnScreen = isOverflowIcon || (isImageIcon && this.profile);
523+
const shouldStayOnScreen = isOverflowIcon || (isImageIcon && this.hasProfile);
524524

525525
return Object.assign({}, info, {
526526
classes: `${info.classes} ${shouldStayOnScreen ? "" : "ui5-shellbar-hidden-button"} ui5-shellbar-button`,
@@ -785,14 +785,14 @@ class ShellBar extends UI5Element {
785785
},
786786
{
787787
text: "Person",
788-
classes: `${this.profile ? "" : "ui5-shellbar-invisible-button"} ui5-shellbar-image-button ui5-shellbar-button`,
788+
classes: `${this.hasProfile ? "" : "ui5-shellbar-invisible-button"} ui5-shellbar-image-button ui5-shellbar-button`,
789789
priority: 4,
790790
subclasses: "ui5-shellbar-image-buttonImage",
791-
style: `order: ${this.profile ? 5 : -10};`,
791+
style: `order: ${this.hasProfile ? 5 : -10};`,
792792
profile: true,
793793
id: `${this._id}-item-${3}`,
794-
domOrder: this.profile ? (++domOrder) : -1,
795-
show: this.profile,
794+
domOrder: this.hasProfile ? (++domOrder) : -1,
795+
show: this.hasProfile,
796796
press: this._handleProfilePress.bind(this),
797797
_tabIndex: "-1",
798798
},
@@ -863,6 +863,10 @@ class ShellBar extends UI5Element {
863863
return getRTL() ? "rtl" : undefined;
864864
}
865865

866+
get hasProfile() {
867+
return !!this.profile.length;
868+
}
869+
866870
static async onDefine() {
867871
await Promise.all([
868872
Icon.define(),

0 commit comments

Comments
 (0)