Skip to content

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

@gregorygossart

Description

@gregorygossart

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    React 🔵Related to React components librarybug 🐛Something isn't workingcommunity 👥As we stopped improvements for this version of Vitamin, this issue needs to be done by the community

    Type

    No type

    Projects

    Status

    🔖 Dev to do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions