Skip to content

Commit 1f8de4a

Browse files
dobrinyonkovilhan007
authored andcommitted
fix(ui5-shellbar): primary title menu is closed on content click (#3032)
1 parent b74eee9 commit 1f8de4a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/fiori/src/ShellBar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ class ShellBar extends UI5Element {
464464
}
465465

466466
_menuItemPress(event) {
467+
this.menuPopover.close();
467468
this.fireEvent("menu-item-click", {
468469
item: event.detail.item,
469470
}, true);

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ describe("Component Behavior", () => {
2828
browser.url(`http://localhost:${PORT}/test-resources/pages/ShellBar.html`);
2929
});
3030

31+
32+
describe("ui5-shellbar menu", () => {
33+
it("tests close on content click", () => {
34+
const primaryTitle = browser.$("#shellbar").shadow$(".ui5-shellbar-menu-button");
35+
const staticAreaItemClassName = browser.getStaticAreaItemClassName("#shellbar")
36+
const menuPopover = browser.$(`.${staticAreaItemClassName}`).shadow$(".ui5-shellbar-menu-popover");
37+
const firstMenuItem = menuPopover.$("ui5-list > ui5-li");
38+
39+
primaryTitle.click();
40+
firstMenuItem.click();
41+
42+
assert.strictEqual(menuPopover.getProperty("opened"), false, "Count property propagates to ui5-button");
43+
});
44+
});
45+
46+
3147
describe("ui5-shellbar-item", () => {
3248
it("tests count property", () => {
3349
const shellbar = browser.$("#shellbarwithitems");
@@ -300,6 +316,7 @@ describe("Component Behavior", () => {
300316
assert.strictEqual(input.getValue(), "Application 1", "Input value is set by click event of the first menu item");
301317
assert.strictEqual(inputData.getValue(), "key1", "The user defined attributes are available.");
302318

319+
primaryTitle.click();
303320
secondMenuItem.click();
304321

305322
assert.strictEqual(input.getValue(), "Application 2", "Input value is set by click event of the second menu item");

0 commit comments

Comments
 (0)