Skip to content
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

InputNumber Up Down buttons send form on submit #313

Closed
fairking opened this issue May 12, 2020 · 5 comments
Closed

InputNumber Up Down buttons send form on submit #313

fairking opened this issue May 12, 2020 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@fairking
Copy link

Primevue: v1.3.2
My form is being sent when up/down buttons are pressed. See bellow example:

<form @submit.prevent="onSubmit">
  <InputNumber />
  <Button label="Save" />
</form>

The solution is to add type="button" to the up/down buttons in InputNumber component.
Thanks.

@fairking
Copy link
Author

fairking commented May 12, 2020

There might be similar issues with other components.

@cagataycivici cagataycivici self-assigned this May 16, 2020
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 16, 2020
@cagataycivici cagataycivici added this to the 2.0.0-rc.1 milestone May 16, 2020
@cagataycivici
Copy link
Member

Default type is button now for all components that use buttons so resolved the issue, thank you.

@fairking
Copy link
Author

Thank you @cagataycivici 👍

@vcmenezes
Copy link

The image component is submitting my form when clicking in the preview overlay, how to fix it?

@vcmenezes
Copy link

To fix the issue for the image component:

<Image
  :src="image.objectURL || image.url"
  :pt="{
    button: {
      type: 'button',
    },
  }"
  :preview="true"
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants