-
Notifications
You must be signed in to change notification settings - Fork 82
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
Delete product in cart when we set zero qty and submit with Enter key #607
Conversation
@@ -64,7 +64,18 @@ const useQuantityInput: Theme.QuantityInput.Function = ( | |||
} | |||
|
|||
if (event.key === ENTER_KEY) { | |||
updateQuantity(qtyInputGroup, 1); | |||
if (qtyInput.value === '0') { | |||
const targetItem = qtyInput.closest('.cart__item'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should introduce a new entry in the selector-map 🤔
https://github.com/PrestaShop/hummingbird/blob/develop/src/js/constants/selectors-map.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except the selector to be added to the dedicated file as @kpodemski suggested 👍
b7a3545
to
6ec8f3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No loading animation when Enter is pressed |
we need to delete the product in cart when we set zero and type Enter to submit.
--
Additional info issue from the release tests
In Shopping cart page, when you put 0 on the quantity and press Enter, the product won't be removed ❌
The product is removed only when you click on the Checkmark.
Screen.Recording.2024-02-23.at.14.17.14.mov