vtex-apps / product-quantity

The Product Quantity allows users to a add a chosen amount of the displayed product in their cart.
0 stars 14 forks source link

fix: input changing to text when selecting maximum available quantity #53

Closed iago1501 closed 2 years ago

iago1501 commented 2 years ago

What problem is this solving?

We are changing the input type to text when selecting the maximum available quantity when the input type is a dropdown.

We have the max dropdown value, that triggers the input type text if the user wants to add more than the maximum allowed in the dropdown, but, if it exceeds the max quantity of products available, we should not display the input type text

How to test it?

Select the maximum available quantity in product quantity dropdown

New behavior

Old behavior

Screenshots or example usage:

image

Alternatives

Remove the entire available quantity validation, maintaining only the validation for MAX_DROPDOWN_VALUE. When will the user exceed the maximum available quantity in the dropdown?

    if (
      internalBehavior === 'dropdown' &&
      newValidatedValue >= MAX_DROPDOWN_VALUE
    ) {
      setInternalBehavior('input')
    }

Another purpose

Related to / Depends on

How does this PR make you feel? :link:

vtex-io-ci-cd[bot] commented 2 years ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

vtex-io-docs-bot[bot] commented 2 years ago

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

In order to keep track, I'll create an issue if you decide now is not a good time

vtex-io-ci-cd[bot] commented 2 years ago

Your PR has been merged! App is being published. :rocket: Version 1.8.0 → 1.8.1

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.product-quantity@1.8.1

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. :book: