Skip to content

Commit

Permalink
some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MapTo0 committed May 15, 2019
1 parent bfa5566 commit e950be6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/MultiComboBox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
?readonly={{ctr.readonly}}
value-state="{{ctr.valueState}}"
show-suggestions
@input="{{ctr._inputChage}}"
@ui5-input="{{ctr._inputChage}}"
@keydown="{{ctr._keydown}}">

<ui5-tokenizer data-ui5-slot="_beginContent"
Expand Down
5 changes: 4 additions & 1 deletion packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,19 @@ class MultiComboBox extends UI5Element {
const value = input.value;
const filteredItems = this._filterItems(value);
const oldValueState = input.valueState;
debugger

if (!filteredItems.length && value && this.validateInput) {
input.value = this._inputLastValue;
input.valueState = "Error";

setTimeout(() => {
input.valueState = oldValueState;
}, 2000);
return;
}


this._inputLastValue = input.value;
this.value = input.value;
this._filteredItems = filteredItems;
Expand Down Expand Up @@ -329,6 +331,7 @@ class MultiComboBox extends UI5Element {
}

otherPopover && otherPopover.close();

popover && popover.openBy(this);
}

Expand Down
12 changes: 5 additions & 7 deletions packages/main/test/specs/MultiComboBox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ describe("MultiComboBox general interaction", () => {
input.click();
input.keys("c");

const list = browser.findElementDeep("#mcb >>> .ui5-multi-combobox-all-items--popover ui5-list");
const list = browser.findElementDeep("#mcb >>> .ui5-multi-combobox-all-items-list");

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


assert.strictEqual(list.getProperty("items").length, 3, "3 items should be shown");

input.keys("o");
Expand Down Expand Up @@ -85,13 +87,9 @@ describe("MultiComboBox general interaction", () => {
it("tests if n more is applied and corresponding popover", () => {
$("#more-mcb").scrollIntoView();

const token1 = browser.findElementDeep("#more-mcb >>> ui5-tokenizer ui5-token[slot='tokens-1']");
const token2 = browser.findElementDeep("#more-mcb >>> ui5-tokenizer ui5-token[slot='tokens-2']");
const token3 = browser.findElementDeep("#more-mcb >>> ui5-tokenizer ui5-token[slot='tokens-3']");
const nMoreText = browser.findElementDeep("#more-mcb >>> ui5-tokenizer >>> .ui5-tokenizer-more-text");

assert.ok(token1.isDisplayed(), "token 1 should be visible");
assert.ok(token2.isDisplayed(), "token 2 should be visible");
assert.ok(!token3.isDisplayed(), "token 3 should not be visible");
assert.ok(nMoreText.getText(), "1 More", "token 1 should be visible");
});
});
});

0 comments on commit e950be6

Please sign in to comment.