Skip to content

Commit 8d98def

Browse files
authored
fix(ui5-multicombobox): enable closing on icon click (#719)
1 parent 1532017 commit 8d98def

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

packages/main/src/MultiComboBox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class MultiComboBox extends UI5Element {
353353
const popover = this._getPopover(isMorePopover);
354354
const otherPopover = this._getPopover(!isMorePopover);
355355

356-
if (popover && popover._isOpen) {
356+
if (popover && popover.opened) {
357357
return popover.close();
358358
}
359359

packages/main/test/sap/ui/webcomponents/main/pages/MultiComboBox.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<span>Predefined value</span>
7878

7979
<br>
80-
<ui5-multi-combobox style="width: 560px;" value="Hello World">
80+
<ui5-multi-combobox id="multi1" style="width: 560px;" value="Hello World">
8181
<ui5-li style="display: none" selected type="Active">Cosy</ui5-li>
8282
<ui5-li style="display: none" type="Active">Compact</ui5-li>
8383
<ui5-li style="display: none" selected type="Active">Condensed</ui5-li>

packages/main/test/specs/MultiComboBox.spec.js

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ const assert = require("assert");
33
describe("MultiComboBox general interaction", () => {
44
browser.url("http://localhost:8080/test-resources/sap/ui/webcomponents/main/pages/MultiComboBox.html");
55

6+
describe("toggling", () => {
7+
it("opens/closes", () => {
8+
const icon = browser.findElementDeep("#multi1 >>> #ui5-multi-combobox-input ui5-icon");
9+
const popover = browser.findElementDeep("#multi1 >>> .ui5-multi-combobox-all-items-popover >>> .ui5-popup-root");
10+
11+
icon.click();
12+
assert.ok(popover.isDisplayedInViewport(), "Popover should be displayed in the viewport");
13+
14+
icon.click();
15+
assert.ok(!popover.isDisplayedInViewport(), "Popover should close");
16+
});
17+
});
18+
619
describe("selection and filtering", () => {
720

821
it("Opens all items popover, selects and deselects the first item", () => {

0 commit comments

Comments
 (0)