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

Component: InputNumber unneeded update model on blur #15799

Closed
Zodiark1020 opened this issue Jun 6, 2024 · 3 comments · Fixed by #15948 · 4 remaining pull requests
Closed

Component: InputNumber unneeded update model on blur #15799

Zodiark1020 opened this issue Jun 6, 2024 · 3 comments · Fixed by #15948 · 4 remaining pull requests
Assignees
Labels
LTS-FIXED-15.4.22 LTS-FIXED-16.9.12 LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Zodiark1020
Copy link

Describe the bug

When using p-inputNumber component with updateOn 'blur' strategy, the model is updated on blur even when no changes were made.
This causes many unwanted notifications to the form and potentially to other controls.

My use case is in a reactive form, though this behaviour also happens with ngModel due to the else if in this method:
img

Environment

Angular 17
PrimeNG 17.17.0

Reproducer

No response

Angular version

17.3.x

PrimeNG version

17.17.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.x

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

I expect what already happens on updateOn 'change', i.e., when the value hasn't changed there is no need to call onModelChange

@Zodiark1020 Zodiark1020 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 6, 2024
@mehmetcetin01140
Copy link
Contributor

Hi,

Could you please share a stackblitz example so we can identify the issue clearly?

@mehmetcetin01140 mehmetcetin01140 added Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 6, 2024
@Zodiark1020
Copy link
Author

Zodiark1020 commented Jun 6, 2024

Hi, sure.
It's a test with ngModel; prints trigger count and what I deem to be valid trigger count:
inputNumber test

@Zodiark1020
Copy link
Author

Any news about this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment