InputNumber value change event

UI Components for Vue
Post Reply
dopi
Posts: 5
Joined: 27 Aug 2020, 11:17

27 Aug 2020, 11:30

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.

cagatay.civici
Prime
Posts: 18428
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

10 Oct 2020, 18:16

What is your PrimeVue version?

dopi
Posts: 5
Joined: 27 Aug 2020, 11:17

12 Oct 2020, 11:19

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.

cagatay.civici
Prime
Posts: 18428
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Oct 2020, 21:44

I'll ask our inputnumber expert Mert to drop by here for response :)

mert.sincan
Posts: 4352
Joined: 29 Jun 2013, 12:38

13 Oct 2020, 16:00

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

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest