Skip to content

Commit b84b9d8

Browse files
authored
fix(ui5-shellbar): fire logoClick on small size (#1192)
1 parent 6847f5e commit b84b9d8

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

packages/fiori/src/ShellBar.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{#if showArrowDown}}
1717
<button tabindex="0" class="{{classes.button}}" @click="{{_header.press}}">
1818
{{#if interactiveLogo}}
19-
<img class="ui5-shellbar-logo" src="{{logo}}" />
19+
<img class="ui5-shellbar-logo" src="{{logo}}" @click="{{_logoPress}}" />
2020
{{/if}}
2121

2222
{{#if primaryTitle}}

packages/fiori/test/pages/ShellBar.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
></ui5-shellbar>
8282

8383
<ui5-shellbar
84+
id="shellbarWithLogoClick"
8485
class="shellbar-example"
8586
logo="https://upload.wikimedia.org/wikipedia/commons/5/59/SAP_2011_logo.svg"
8687
primary-title="SAP Labs Bulgaria"
@@ -158,9 +159,8 @@
158159
</ui5-list>
159160
</ui5-popover>
160161

161-
<ui5-input id="press-input" style="margin-top: 2rem; width: 240px;">
162-
163-
</ui5-input>
162+
<ui5-input id="press-input" style="margin-top: 2rem;"></ui5-input>
163+
<ui5-input id="press-input2" style="margin-top: 2rem;"></ui5-input>
164164

165165
<script>
166166
shellbar.addEventListener("ui5-profileClick", function(event) {
@@ -180,6 +180,10 @@
180180
window["press-input"].value = "Logo"
181181
});
182182

183+
shellbarWithLogoClick.addEventListener("ui5-logoClick", function(event) {
184+
window["press-input2"].value = shellbarWithLogoClick.primaryTitle.replace(/\s/g, "");
185+
});
186+
183187
shellbar.addEventListener("ui5-coPilotClick", function(event) {
184188
window["press-input"].value = "CoPilot"
185189
});

packages/fiori/test/specs/ShellBar.spec.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ describe("Component Behavior", () => {
228228
assert.strictEqual(input.getValue(), "Product Switch", "Input value is set by click event of Product Switch icon");
229229
});
230230

231-
it("tests logoPress event", () => {
231+
it("tests logoClick event", () => {
232232
const logo = browser.$("#shellbar").shadow$(".ui5-shellbar-logo");
233233
const input = browser.$("#press-input");
234234

@@ -283,6 +283,15 @@ describe("Component Behavior", () => {
283283
browser.setWindowSize(510, 1080);
284284
});
285285

286+
it("tests logoClick event", () => {
287+
const logo = browser.$("#shellbarWithLogoClick").shadow$(".ui5-shellbar-logo");
288+
const title = "SAPLabsBulgaria";
289+
const input = browser.$("#press-input2");
290+
291+
logo.click();
292+
assert.strictEqual(input.getValue(), title, "Input value is set by click event of Logo");
293+
});
294+
286295
it("tests opening of menu", () => {
287296
const primaryTitle = browser.$("#shellbar").shadow$(".ui5-shellbar-menu-button");
288297
const staticAreaItemClassName = browser.getStaticAreaItemClassName("#shellbar")

0 commit comments

Comments
 (0)