diff --git a/src/virtual-select.js b/src/virtual-select.js index 82d8be8..34806ea 100755 --- a/src/virtual-select.js +++ b/src/virtual-select.js @@ -2550,8 +2550,10 @@ export class VirtualSelect { isAllSelected = this.isAllOptionsSelected(); } - /** when all options not selected, checking if all visible options selected */ - if (!isAllSelected && this.selectAllOnlyVisible) { + /** when all options not selected, checking if all visible options selected + * Also, in a search mode, validate that we still have visible items + */ + if (!isAllSelected && this.selectAllOnlyVisible && (this.searchValue !== '' && this.visibleOptionsCount > 0 || this.searchValue == '')) { isAllVisibleSelected = this.isAllOptionsSelected(true); }