Spinner in form doesn't work

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
Helayxa
Posts: 19
Joined: 31 Oct 2016, 21:07

14 Feb 2017, 10:29

Hi,

When I put a Spinner in a form, when I click on the Spinner buttons to change the value, I think that the button click is considered as a submit action because the page is reloaded each time I click on the button.

For example, on the Ultima Live Preview, just add a form tag around the p-spinner tag, click on the up arrow or down arrow and the page will be refreshed...

Any idea how to fix it ?

Thanks.

NGAllie
Posts: 24
Joined: 21 Sep 2016, 20:36

16 Feb 2017, 16:38

Hi,

We had the same issue with a dynamic model driven form when we upgraded to Angular 2.0.0.

We found out that we had left in the html a declaration to call a onSubmit() method but we were not using it and we didn't have the corresponding method in the form class.

Code: Select all

 <form (ngSubmit)="onSubmit()" [formGroup]="form">
With this code, Angular would generate an error and immediately reload the app when one of the buttons of a spinner control would be pressed. This behavior didn't append when we were using the up and down arrows on the keyboard to increase or decrease the value inside the spinner.

In our case, the fix was simply to remove the call to onSubmit() in our html.

Code: Select all

 <form [formGroup]="form"> 


So, it does seem that the spinner buttons have a side effect on the onSubmit event of forms.

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

17 Feb 2017, 09:38

Hi,

We replicated this issue and we will fix it in the next release. For spinner and other components that have buttons in it. After the fix you can use it like this;

Code: Select all

<form (ngSubmit)="onSubmit()" [formGroup]="form">

Post Reply

Return to “Ultima - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests