Skip to content

Commit 84362e0

Browse files
authored
fix(ui5-multi-combobox): fix behavior of show all selected button (#2100)
1 parent 20c55ed commit 84362e0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/main/src/MultiComboBox.js

+13
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,22 @@ class MultiComboBox extends UI5Element {
335335
}
336336

337337
filterSelectedItems(event) {
338+
if (this.allItemsSelected) {
339+
this.filterSelected = true;
340+
return;
341+
}
342+
338343
this.filterSelected = event.target.pressed;
339344
}
340345

346+
get _showAllItemsButtonPressed() {
347+
return this.filterSelected || this.allItemsSelected;
348+
}
349+
350+
get allItemsSelected() {
351+
return this.items.length === this.selectedValues.length;
352+
}
353+
341354
get _inputDom() {
342355
return this.shadowRoot.querySelector("#ui5-multi-combobox-input");
343356
}

packages/main/src/MultiComboBoxPopover.hbs

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
class="ui5-multi-combobox-toggle-button"
4545
icon="multiselect-all"
4646
design="Transparent"
47-
?pressed={{filterSelected}}
47+
?pressed={{_showAllItemsButtonPressed}}
48+
?disabled={{allItemsSelected}}
4849
@click="{{filterSelectedItems}}"
4950
></ui5-togglebutton>
5051
</div>

0 commit comments

Comments
 (0)