Skip to content

Commit 691c2e4

Browse files
authored
fix(ui5-combobox): User action cancelled when clicking "X" on mobile (#2742)
Fixes: #2449
1 parent a9913c3 commit 691c2e4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/main/src/ComboBox.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ class ComboBox extends UI5Element {
468468

469469
_afterOpenPopover() {
470470
this._iconPressed = true;
471+
472+
if (isPhone() && this.value) {
473+
this.filterValue = this.value
474+
}
475+
471476
this._clearFocus();
472477
}
473478

@@ -631,7 +636,13 @@ class ComboBox extends UI5Element {
631636
}
632637
}
633638

634-
_closeRespPopover() {
639+
_closeRespPopover(event) {
640+
if (isPhone() && event && event.target.classList.contains("ui5-responsive-popover-close-btn") && this._selectedItemText) {
641+
this.value = this._selectedItemText;
642+
this.filterValue = this._selectedItemText;
643+
this._tempValue = this._selectedItemText;
644+
}
645+
635646
this.responsivePopover.close();
636647
}
637648

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

695706
this._tempValue = listItem.mappedItem.text;
707+
this._selectedItemText = listItem.mappedItem.text;
696708
this.filterValue = this._tempValue;
697709

698710
if (!listItem.mappedItem.selected) {

0 commit comments

Comments
 (0)