Skip to content

Commit

Permalink
fix(ui5-combobox): User action cancelled when clicking "X" on mobile (#…
Browse files Browse the repository at this point in the history
…2742)

Fixes: #2449
  • Loading branch information
Martotko committed Feb 12, 2021
1 parent a9913c3 commit 691c2e4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/main/src/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ class ComboBox extends UI5Element {

_afterOpenPopover() {
this._iconPressed = true;

if (isPhone() && this.value) {
this.filterValue = this.value
}

this._clearFocus();
}

Expand Down Expand Up @@ -631,7 +636,13 @@ class ComboBox extends UI5Element {
}
}

_closeRespPopover() {
_closeRespPopover(event) {
if (isPhone() && event && event.target.classList.contains("ui5-responsive-popover-close-btn") && this._selectedItemText) {
this.value = this._selectedItemText;
this.filterValue = this._selectedItemText;
this._tempValue = this._selectedItemText;
}

this.responsivePopover.close();
}

Expand Down Expand Up @@ -693,6 +704,7 @@ class ComboBox extends UI5Element {
const listItem = event.detail.item;

this._tempValue = listItem.mappedItem.text;
this._selectedItemText = listItem.mappedItem.text;
this.filterValue = this._tempValue;

if (!listItem.mappedItem.selected) {
Expand Down

0 comments on commit 691c2e4

Please sign in to comment.