-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table filter set undefined #14588
Comments
We are also encountering this bug in the latest release (17.4.0). It works in our previous version (16.0.2) of PrimeNG. When typing anything into the filter, the word "undefined" appears in the text box. This issue appears to have been introduced by #14433, which fixed #14432, because the individual custom filters are now being nested inside an array. Unfortunately, this is a breaking change in a minor release. Here's an example snippet of our code that has this issue: <input
id="network-name-filter"
type="text"
(input)="utilitiesService.tableFilter(tableRef, 'networkName', $event)"
[value]="utilitiesService.castFilterAsMetadata(tableRef.filters['networkName'])?.value"
placeholder="Filter Network Name"
/> The tableFilter(
tableRef: Table,
propertyName: string,
event: Event,
matchMode: string = FilterMatchMode.CONTAINS
) {
const target =
event.target instanceof HTMLInputElement
? event.target
: (event.target as HTMLSelectElement);
tableRef.filter(target.value, propertyName, matchMode as string);
} The castFilterAsMetadata(
filter: FilterMetadata | FilterMetadata[] | undefined
): FilterMetadata | undefined {
return filter as FilterMetadata;
} |
Having this issue as well. |
I guess there was an unintended breaking change. Could you please provide a stackblitz example so we can identify and address the issue? I'm moving this to the next week's milestone until the reproducer arrives. |
Fixed in #15053 |
Describe the bug
I am using table component with this filter box:
Using PrimeNG 17.3.0 all works well. With 17.3.1 and up, sets undefined in the inputbox when you write a character in it.
Environment
Angular 17
Prime 17.3.3
Reproducer
No response
Angular version
17
PrimeNG version
17.3.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v18.18.2
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Work like in 17.3.0
The text was updated successfully, but these errors were encountered: