Skip to content

Commit

Permalink
fix(ui5-combobox): allow typing in input on mobile devices (#2412)
Browse files Browse the repository at this point in the history
Allow typing in the input field when using a mobile device.

FIXES: #2324
  • Loading branch information
ivoplashkov authored and ilhan007 committed Nov 19, 2020
1 parent 2ebf9f4 commit a7666ec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/main/src/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class ComboBox extends UI5Element {
this.inner.focus();
}

if (this.shouldClosePopover()) {
if (this.shouldClosePopover() && !isPhone()) {
this.responsivePopover.close(false, false, true);
}

Expand All @@ -456,13 +456,14 @@ class ComboBox extends UI5Element {
this.filterValue = this.value;
}

event.target.setSelectionRange(0, this.value.length);
!isPhone() && event.target.setSelectionRange(0, this.value.length);
}

_focusout() {
this.focused = false;

this._inputChange();
!isPhone() && this._closeRespPopover();
}

_afterOpenPopover() {
Expand Down Expand Up @@ -545,6 +546,10 @@ class ComboBox extends UI5Element {

this._filteredItems = this._filterItems(value);

if (isPhone()) {
return;
}

if (!this._filteredItems.length) {
this._closeRespPopover();
} else {
Expand Down Expand Up @@ -610,6 +615,7 @@ class ComboBox extends UI5Element {

if (isEnter(event)) {
this._inputChange();
this._closeRespPopover();
}

if (isShow(event) && !this.readonly && !this.disabled) {
Expand Down Expand Up @@ -677,8 +683,6 @@ class ComboBox extends UI5Element {
this.fireEvent("change");
this.inner.setSelectionRange(this.value.length, this.value.length);
}

this._closeRespPopover();
}

_itemMousedown(event) {
Expand Down Expand Up @@ -706,6 +710,7 @@ class ComboBox extends UI5Element {
});

this._inputChange();
this._closeRespPopover();
}

_onItemFocus(event) {
Expand Down

0 comments on commit a7666ec

Please sign in to comment.