diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index 7df4436f1..23ff83d0b 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -182,11 +182,11 @@ export default { }; }, methods: { - focusSearchInput() { + focusSearchInput(event) { // Focus cursor in input when search icon is clicked const field = document.querySelector("input"); field.focus(); - this.$emit("search-icon-click"); + this.$emit("search-icon-click", event); }, async imageChanged(e) { let file = e.target.files[0]; diff --git a/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue b/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue index 8fe355923..0bc88799b 100644 --- a/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue +++ b/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue @@ -8,7 +8,6 @@ cornerStyle="rounded" mask="#####" :includeSearchIcon="includeSearchIcon" - @search-icon-click="$emit('search-icon-click')" :displayQuestionText="false" :isRequired="isRequired" :validationRules="computedValidationRules" /> diff --git a/src/layouts/service-location/shop-question/shop-question-popup.vue b/src/layouts/service-location/shop-question/shop-question-popup.vue index 16c555dec..59d7ddcd4 100644 --- a/src/layouts/service-location/shop-question/shop-question-popup.vue +++ b/src/layouts/service-location/shop-question/shop-question-popup.vue @@ -111,7 +111,7 @@ export default { localZipCode: this.zipCodeFromParent, answers: [], shopListButton: shopListButton, - indexOfLastShopDisplayed: 0, + indexOfLastShopToBeDisplayed: 0, localShopProviderData: this.shopProviderDataFromParent, // Why does parent manage this sometimes, but not all of the time A: to prevent another call to get providers on initial load localSelectedProviderNumber: null, // Revisit this, maybe not too hard displayInvalidZipAlert: false, // part of big refactor of asyn calls @@ -158,7 +158,7 @@ export default { displaySeeMoreLocationsLink() { if (!this.shopProviders.length) return false; - return this.indexOfLastShopDisplayed < this.shopProviders.length; + return this.indexOfLastShopToBeDisplayed < this.shopProviders.length; }, }, @@ -183,9 +183,9 @@ export default { }); }; - const indexOfLastShopToReturn = this.indexOfLastShopDisplayed + numberOfShopsToGet; - const nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopDisplayed, indexOfLastShopToReturn); - this.indexOfLastShopDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length; + const indexOfLastShopToReturn = this.indexOfLastShopToBeDisplayed + numberOfShopsToGet; + const nextShopProvidersFromList = this.shopProviders.slice(this.indexOfLastShopToBeDisplayed, indexOfLastShopToReturn); + this.indexOfLastShopToBeDisplayed = indexOfLastShopToReturn < this.shopProviders.length ? indexOfLastShopToReturn : this.shopProviders.length; const nextShopAnswersFromList = nextShopProvidersFromList.map((shopProvider) => { const streetAddress = toTitleCase(shopProvider.address.streetAddress); @@ -227,9 +227,9 @@ export default { ); if (selectedProviderNumberFromParentIndex > -1) { - this.indexOfLastShopDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3; + this.indexOfLastShopToBeDisplayed = Math.ceil((selectedProviderNumberFromParentIndex + 1) / 3) * 3; } else { - this.indexOfLastShopDisplayed = 3; + this.indexOfLastShopToBeDisplayed = 3; } this.localShopProviderData = this.shopProviderDataFromParent; @@ -304,10 +304,10 @@ export default { // If not found, only show the first 3 shops if (selectedIndex === -1) { - this.indexOfLastShopDisplayed = 3; + this.indexOfLastShopToBeDisplayed = 3; } - const sortedShops = this.getShopsByZip(zipCode, this.shopProviders, this.indexOfLastShopDisplayed); + const sortedShops = this.getShopsByZip(zipCode, this.shopProviders, this.indexOfLastShopToBeDisplayed); const toTitleCase = (str) => { return str.replace(/\w\S*/g, function (txt) { @@ -338,7 +338,7 @@ export default { ) { this.localSelectedProviderNumber = null; } - this.indexOfLastShopDisplayed = mappedData.length; + this.indexOfLastShopToBeDisplayed = mappedData.length; this.displayNoShopsAlert = this.answers.length === 0; }, resetModalButtonStyle() {