Skip to content

Commit

Permalink
One by one. Quantity [Fix: Mobile experience]
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanlopezluna committed Jul 23, 2023
1 parent f354d4d commit 0a62108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Fix poor behaviour on mobile when user needs to change item quantity

## [3.12.7] - 2023-03-28

Expand Down
3 changes: 2 additions & 1 deletion react/AutocompleteBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ const AutocompleteBlock: FunctionComponent<any & WrappedComponentProps> = ({
min={unitMultiplier}
step={unitMultiplier}
onChange={(e: any) => {
if (e.target.value > 0) {
if (e.target.value >= 0) {
setState({
...state,
quantitySelected: e.target.value,
Expand All @@ -412,6 +412,7 @@ const AutocompleteBlock: FunctionComponent<any & WrappedComponentProps> = ({
variation="primary"
size="small"
isLoading={loading}
disabled={state.quantitySelected === '' || state.quantitySelected < unitMultiplier}
onClick={() => {
callAddUnitToCart()
}}
Expand Down

0 comments on commit 0a62108

Please sign in to comment.