Skip to content

Commit

Permalink
fix(ui5-multi-combobox): fix behavior of show all selected button (#2100
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fifoosid committed Aug 18, 2020
1 parent 20c55ed commit 84362e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,22 @@ class MultiComboBox extends UI5Element {
}

filterSelectedItems(event) {
if (this.allItemsSelected) {
this.filterSelected = true;
return;
}

this.filterSelected = event.target.pressed;
}

get _showAllItemsButtonPressed() {
return this.filterSelected || this.allItemsSelected;
}

get allItemsSelected() {
return this.items.length === this.selectedValues.length;
}

get _inputDom() {
return this.shadowRoot.querySelector("#ui5-multi-combobox-input");
}
Expand Down
3 changes: 2 additions & 1 deletion packages/main/src/MultiComboBoxPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
class="ui5-multi-combobox-toggle-button"
icon="multiselect-all"
design="Transparent"
?pressed={{filterSelected}}
?pressed={{_showAllItemsButtonPressed}}
?disabled={{allItemsSelected}}
@click="{{filterSelectedItems}}"
></ui5-togglebutton>
</div>
Expand Down

0 comments on commit 84362e0

Please sign in to comment.