Skip to content

Commit

Permalink
Add disabled state to Quick Add Bulk (#3391)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiamatulis committed Apr 3, 2024
1 parent 8c82f06 commit 1b34f48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/quick-add-bulk.js
Expand Up @@ -99,7 +99,7 @@ if (!customElements.get('quick-add-bulk')) {
updateCart(event) {
this.lastActiveInputId = event.target.getAttribute('data-index');
this.quantity = this.querySelector('quantity-input')
// this.quantity.classList.add('loading');
this.quantity.classList.add('quantity__input-disabled');
this.selectProgressBar().classList.remove('hidden');
const body = JSON.stringify({
quantity: event.target.value,
Expand Down Expand Up @@ -158,6 +158,7 @@ if (!customElements.get('quick-add-bulk')) {
event.target.reportValidity();
this.resetQuantityInput(event.target.id);
this.selectProgressBar().classList.add('hidden');
this.quantity.classList.remove('quantity__input-disabled');
event.target.select();
this.cleanErrorMessageOnType(event);
// Error handling
Expand Down
4 changes: 4 additions & 0 deletions assets/quick-add.css
Expand Up @@ -365,3 +365,7 @@ quick-add-bulk .quantity__input {
width: calc(6.5rem / var(--font-body-scale));
flex-grow: 0;
}

.quantity__input-disabled {
pointer-events: none;
}

0 comments on commit 1b34f48

Please sign in to comment.