Skip to content

Commit

Permalink
Fixed #14432
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiolucenaribas committed Dec 26, 2023
1 parent a99d8d6 commit 310544a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ export class Table implements OnInit, AfterViewInit, AfterContentInit, Blockable
clearTimeout(this.filterTimeout);
}
if (!this.isFilterBlank(value)) {
this.filters[field] = { value: value, matchMode: matchMode };
this.filters[field] = field == 'global'? { value: value, matchMode: matchMode } : [{ value: value, matchMode: matchMode }];
} else if (this.filters[field]) {
delete this.filters[field];
}
Expand Down

3 comments on commit 310544a

@araklefeistel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an issue to most of primeng user. After that change a table filter event will encapsulate value and matchMode in an Array. I think a lot of people will cause this pain. Is there a good reason for that tremendous change?

@fabiolucenaribas
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this approach makes it possible to apply multiple filters to the same field, considering the inherent complexity, in which the field can be both an object and an array. Therefore, implementation requires special attention to adequately cover both scenarios.

@araklefeistel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's the intend here. But even if you just got a simple value it will be encapsulated in an array.

Please sign in to comment.