[v4] InputNumber: Missing type declaration for buttons leads to form submit on button click #5700
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
In PrimeVue v4 the InputNumber component uses normal html button elements for increase/decrease buttons. However, they lack a type specification. This leads to the problem that clicking the buttons will perform a form submit when placed within a form. This behavior might be browser specific, but is reproduceable in Google Chrome on Windows
According to the w3c spec:
The attribute's missing value default and invalid value default are both the Submit Button state.
Reproducer
https://stackblitz.com/edit/vitejs-vite-wk6pwr?file=src%2FApp.vue
PrimeVue version
4.0.0-beta.2
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Google Chrome
Steps to reproduce the behavior
In the stackblitz code it will perform a form post when you click on the button in the InputNumber enclosed in the form (white page), however it will work flawlessly when used outside of a form element.
Expected behavior
Never perform a form submit.
The text was updated successfully, but these errors were encountered: