New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] v-pagination trigger v-form submit #5212
Comments
If you look at the v-data-table example with external pagination, you place the v-pagination outside of the v-data-table and sync the items within using the "pagination.sync" property. Perhaps you can do something similar with your form? |
Sorry, that's not what I meant. If you look at the example you will notice that the form is sent when you click on a page. I have to use the v-pagination inside a form only for displaying items, i don't need to use paginations data with the form. |
Okay so after some digging, the buttons used for the pagination component use the standard HTML tag rather than . The standard HTML button object's event defaults to submit "default for all browsers, except Internet Explorer" (from w3schools) and so that's the case for the buttons used within the pagination component since their type isn't defined as seen here. You can test this by putting a standard button within a form without a type or click function attached to it and it'll submit the form which is the same as your issue. You can even go in and manually change the types of each button in the pagination to "button" and it'll stop the form from submitting. I still think you'd be able to achieve what you want with the pagination component outside of the form or use something like the v-stepper but for now it seems the buttons within will keep firing off the default submit event unless you're able to somehow override this. Maybe this can get looked into by the dev team and maybe they can change the type for these buttons to "button" instead? |
You are right, thank you! I'll try to fix this and make a pull request. |
Fixed in v1.3.3 with #5229 |
Versions and Environment
Vuetify: 1.2.6
Vue: 2.5.17
Browsers: Chrome69
OS: Windows 10
Steps to reproduce
Use the v-pagination component inside a v-form or form and change page
Expected Behavior
It should not trigger form submit
Reproduction Link
https://codepen.io/materight/pen/YJwgZy
The text was updated successfully, but these errors were encountered: