Skip to content

Commit 7bf44b5

Browse files
authored
fix(ui5-combobox): allow typing in input on mobile devices (#2412)
Allow typing in the input field when using a mobile device. FIXES: #2324
1 parent 64fef90 commit 7bf44b5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/main/src/ComboBox.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ class ComboBox extends UI5Element {
435435
this.inner.focus();
436436
}
437437

438-
if (this.shouldClosePopover()) {
438+
if (this.shouldClosePopover() && !isPhone()) {
439439
this.responsivePopover.close(false, false, true);
440440
}
441441

@@ -456,13 +456,14 @@ class ComboBox extends UI5Element {
456456
this.filterValue = this.value;
457457
}
458458

459-
event.target.setSelectionRange(0, this.value.length);
459+
!isPhone() && event.target.setSelectionRange(0, this.value.length);
460460
}
461461

462462
_focusout() {
463463
this.focused = false;
464464

465465
this._inputChange();
466+
!isPhone() && this._closeRespPopover();
466467
}
467468

468469
_afterOpenPopover() {
@@ -545,6 +546,10 @@ class ComboBox extends UI5Element {
545546

546547
this._filteredItems = this._filterItems(value);
547548

549+
if (isPhone()) {
550+
return;
551+
}
552+
548553
if (!this._filteredItems.length) {
549554
this._closeRespPopover();
550555
} else {
@@ -610,6 +615,7 @@ class ComboBox extends UI5Element {
610615

611616
if (isEnter(event)) {
612617
this._inputChange();
618+
this._closeRespPopover();
613619
}
614620

615621
if (isShow(event) && !this.readonly && !this.disabled) {
@@ -677,8 +683,6 @@ class ComboBox extends UI5Element {
677683
this.fireEvent("change");
678684
this.inner.setSelectionRange(this.value.length, this.value.length);
679685
}
680-
681-
this._closeRespPopover();
682686
}
683687

684688
_itemMousedown(event) {
@@ -706,6 +710,7 @@ class ComboBox extends UI5Element {
706710
});
707711

708712
this._inputChange();
713+
this._closeRespPopover();
709714
}
710715

711716
_onItemFocus(event) {

0 commit comments

Comments
 (0)