Page 1 of 1

InputNumber value change event

Posted: 27 Aug 2020, 11:30
by dopi
Hello,

I'm using the InputNumber component.

1) I'd like to add the on change listener to update other part of the page. How can I add the linstener on the change event?
2) How can I reduce the width of the InputNumber. I tried

Code: Select all

<InputNumber style="width: 75px />
but it does not work I think because it needs to be applied to the input element.

Thanks.

Re: InputNumber value change event

Posted: 10 Oct 2020, 18:16
by cagatay.civici
What is your PrimeVue version?

Re: InputNumber value change event

Posted: 12 Oct 2020, 11:19
by dopi
Hi, I completly and successfully switched last week to Vue3. I'm using most of the primevue 3 form components also the datatable, but with the InputNumber I have the following question:

1) I'd like to add the on change listener to update other part of the page. How can I add the linstener on the change event?
2) How can I reduce the width of the InputNumber.

Thanks.

Re: InputNumber value change event

Posted: 12 Oct 2020, 21:44
by cagatay.civici
I'll ask our inputnumber expert Mert to drop by here for response :)

Re: InputNumber value change event

Posted: 13 Oct 2020, 16:00
by mert.sincan
Hi,
1) I'd like to add the on change listener to update other part of the page. How can I add the linstener on the change event?
- This component does not behave exactly like a HTML input element. Therefore, you need to use @blur event to simulate the input change event on InputNumber. Please see my comment;
https://github.com/primefaces/primevue/issues/506
In current behavior, the model is updated in two ways;
  • Clicking outside to validate the change after changing something in inputNumber.
  • Changing the value using spinner's button/arrow keys
And the value that comes to the model is the value that is validated.
2) How can I reduce the width of the InputNumber.
- You can use inputStyle property for this after 3.0.1 is released.
https://github.com/primefaces/primevue/issues/551