Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

bug(@vtmn/react): VtmnQuantity "-" and "+" buttons should not validate form instantly #1447

Open gregorygossart opened 1 year ago

gregorygossart commented 1 year ago

Describe the bug When used inside a form, VtmnQuantity "-" and "+" button validate form on click

Steps to reproduce

  1. Create a form
  2. Add a validation system on the form
  3. Add an input with a required value inside the form
  4. Add a VtmnQuantity inside the form
  5. Do not fill the input
  6. Click on the "-" or "+" button of VtmnQuantity
  7. Form is validated and required input is displayed as "with error"

Expected behavior VtmnQuantity "-" and "+" buttons should not validate the form on click.

An easy fix would be to add a type="button" directly on these two buttons. A better way would be to add a default prop type = "button" on VtmnButton, but that could break the way some other components work.

Browsers affected Chrome

Version affected "@vtmn/react": "^3.1.2"

stale[bot] commented 1 year ago

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen whenever you want. Thank you for your contributions.