Skip to content

fix(ui5-multicombobox): enable closing on icon click #719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class MultiComboBox extends UI5Element {
const popover = this._getPopover(isMorePopover);
const otherPopover = this._getPopover(!isMorePopover);

if (popover && popover._isOpen) {
if (popover && popover.opened) {
return popover.close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<span>Predefined value</span>

<br>
<ui5-multi-combobox style="width: 560px;" value="Hello World">
<ui5-multi-combobox id="multi1" style="width: 560px;" value="Hello World">
<ui5-li style="display: none" selected type="Active">Cosy</ui5-li>
<ui5-li style="display: none" type="Active">Compact</ui5-li>
<ui5-li style="display: none" selected type="Active">Condensed</ui5-li>
Expand Down
13 changes: 13 additions & 0 deletions packages/main/test/specs/MultiComboBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ const assert = require("assert");
describe("MultiComboBox general interaction", () => {
browser.url("http://localhost:8080/test-resources/sap/ui/webcomponents/main/pages/MultiComboBox.html");

describe("toggling", () => {
it("opens/closes", () => {
const icon = browser.findElementDeep("#multi1 >>> #ui5-multi-combobox-input ui5-icon");
const popover = browser.findElementDeep("#multi1 >>> .ui5-multi-combobox-all-items-popover >>> .ui5-popup-root");

icon.click();
assert.ok(popover.isDisplayedInViewport(), "Popover should be displayed in the viewport");

icon.click();
assert.ok(!popover.isDisplayedInViewport(), "Popover should close");
});
});

describe("selection and filtering", () => {

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