Skip to content

Commit

Permalink
Merge pull request #7048 from yigitfindikli/multiselectvsblfnc
Browse files Browse the repository at this point in the history
fixed #7047 Multiselect Headercheckbox not working correctly
  • Loading branch information
cagataycivici committed Dec 31, 2018
2 parents ecca8c6 + 4a6edc8 commit 53d6b9a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterContentInit,AfterV

isAllChecked() {
if (this.filterValue && this.filterValue.trim().length) {
return this.value && this.visibleOptions&&this.visibleOptions.length && (this.value.length == this.visibleOptions.length);
return this.value && this.visibleOptions&&this.visibleOptions.length && this.isVisibleOptionsAllChecked();
}
else {
let optionCount = this.getEnabledOptionCount();
Expand All @@ -437,6 +437,20 @@ export class MultiSelect implements OnInit,AfterViewInit,AfterContentInit,AfterV
}
}

isVisibleOptionsAllChecked() {
if (!this.visibleOptions) {
return false;
}
else {
for (let option of this.visibleOptions) {
if (!this.value.find(value => value == option.value)) {
return false;
}
}
return true;
}
}

getEnabledOptionCount(): number {
if (this.options) {
let count = 0;
Expand Down

0 comments on commit 53d6b9a

Please sign in to comment.