primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
9.83k stars 4.5k forks source link

Component: InputNumber unneeded update model on blur #15799

Closed Zodiark1020 closed 1 day ago

Zodiark1020 commented 4 weeks ago

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

mehmetcetin01140 commented 4 weeks ago

Hi,

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

Zodiark1020 commented 4 weeks ago

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

Zodiark1020 commented 2 weeks ago

Any news about this issue?