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

p-inputNumber: Emits number while changing but string when losing focus #15039

Closed
jpgoelz opened this issue Mar 13, 2024 · 6 comments
Closed
Labels
Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response Type: Bug Issue contains a bug related to a specific component. Something about the component is not working

Comments

@jpgoelz
Copy link

jpgoelz commented Mar 13, 2024

Describe the bug

When changing the content of a p-inputNumber, the emitted value correctly is of type number. But as soon as the input loses focus the type changes to string, which may lead too hard to find typing problems.

Environment

Any environment should have this problem. I tested this with the documentation demo StackBlitz (see below).

Reproducer

https://stackblitz.com/edit/m96pfg?file=src%2Fapp%2Fdemo%2Finput-number-numerals-demo.html

Angular version

17.2.2

PrimeNG version

17.10.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

n/a

Browser(s)

Chrome

Steps to reproduce the behavior

In my StackBlitz, change the values of the input fields and see the output below:

numberInput-produces-string

Expected behavior

The emitted type is always number (and maybe undefined/null, if input is empty).

@jpgoelz jpgoelz added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 13, 2024
@dl3g0
Copy link

dl3g0 commented Mar 13, 2024

Hello, I have the same problem, let's hope they fix it in version 17.11.0

@gerardva
Copy link

I'm also experiencing this issue. This seems to be introduced in 17.9.0, as far as I can tell by this change: 82a4050#diff-d15eb5f971fcc845ef140641bb6498419d87b06832dd22180381101c84f55a70R1369

@jpgoelz
Copy link
Author

jpgoelz commented Mar 14, 2024

I'm also experiencing this issue. This seems to be introduced in 17.9.0, as far as I can tell by this change: 82a4050#diff-d15eb5f971fcc845ef140641bb6498419d87b06832dd22180381101c84f55a70R1369

That could also explain, why I keep seeing this Error in my console when emptying the input field:

image

@jpgoelz
Copy link
Author

jpgoelz commented Mar 14, 2024

The issue seems to be resolved in PrimeNG 17.11.0:

https://stackblitz.com/edit/m96pfg-zf4xhr?file=src%2Fapp%2Fdemo%2Finput-number-numerals-demo.ts

@mehmetcetin01140 mehmetcetin01140 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 Mar 18, 2024
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response label Jul 17, 2024
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you for your understanding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants