Skip to content
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

Fileupload and autocomplete: problems with input transform function #15332

Closed
Kue2 opened this issue Apr 22, 2024 · 0 comments · Fixed by #15436
Closed

Fileupload and autocomplete: problems with input transform function #15332

Kue2 opened this issue Apr 22, 2024 · 0 comments · Fixed by #15436
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Kue2
Copy link
Contributor

Kue2 commented Apr 22, 2024

Describe the bug

Since PrimeNG 17.13 we have been encountering unexpected behaviors with some components that now use the numberAttribute transform function for some inputs, probably because it is not defined a fallback value. The problem arise when the input is passed to the prime component, but with an undefined value (which is evaluated as NaN after being processed by the numberAttribute function)

Two examples:
In p-fileupload the input "filelimit" as undefined prevents the upload button from becoming active when a file is selected
https://stackblitz.com/edit/czauw4-y22yf5?file=src%2Fapp%2Fdemo%2Ffile-upload-template-demo.ts

In p-autocomplete the input "maxlength" as undefined renders the component unusable because the maxlength is ultimately evaluated as 0.
https://stackblitz.com/edit/mcz31v?file=src%2Fapp%2Fdemo%2Fautocomplete-basic-demo.html

Environment

Angular

Reproducer

https://stackblitz.com/edit/czauw4-y22yf5?file=src%2Fapp%2Fdemo%2Ffile-upload-template-demo.ts
https://stackblitz.com/edit/mcz31v?file=src%2Fapp%2Fdemo%2Fautocomplete-basic-demo.html

Angular version

17

PrimeNG version

17.13.0 - 17.14.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18

Browser(s)

No response

Steps to reproduce the behavior

  • p-fileupload: set the input "filelimit" as undefined
  • p-autocomplete: set the input "maxlength" as undefined

Expected behavior

No response

@Kue2 Kue2 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 22, 2024
@Kue2 Kue2 changed the title Fileupload and autocomplete: problems with input transform Fileupload and autocomplete: problems with input transform function Apr 22, 2024
Kue2 pushed a commit to Kue2/primeng that referenced this issue May 2, 2024
@cetincakiroglu cetincakiroglu added this to the 17.16.0 milestone May 3, 2024
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants