Created
June 5, 2017 17:41
-
-
Save tvlgiao/ddbabf4f70ab1360e559a8df69837aee to your computer and use it in GitHub Desktop.
[BigCommerce] Fix problem when it enter on quantity box it will decrease 1 unit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/assets/js/theme/common/product-details.js b/assets/js/theme/common/product-details.js | |
index 7e97a13..e09f775 100644 | |
--- a/assets/js/theme/common/product-details.js | |
+++ b/assets/js/theme/common/product-details.js | |
@@ -174,6 +174,20 @@ export default class Product { | |
// update text | |
viewModel.quantity.$text.text(qty); | |
}); | |
+ | |
+ | |
+ // -------------------------------------------------------------------- | |
+ // Giao - emthemesModez: | |
+ // Fix problem when it enter on quantity box it will decrease 1 unit | |
+ // -------------------------------------------------------------------- | |
+ | |
+ this.$scope.on('keypress', this.getViewModel(this.$scope).quantity.$input, (event) => { | |
+ if (event.keyCode === 13) { | |
+ event.preventDefault(); | |
+ } | |
+ }); | |
+ | |
+ // -------------------------------------------------------------------- | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment