All defaults selection logic is working

This commit is contained in:
Jason Wheeler 2023-02-16 16:31:48 -05:00
parent 76b31a3faa
commit c46d527acb
2 changed files with 12 additions and 13 deletions

View file

@ -179,14 +179,6 @@ export default {
return tintSourceObject.src;
},
// Reset selections when tint changes for the same glass to ensure proper selection.
// Also checks if only a single part is present for the tint.
ResetTintAndPartSelections() {
this.selectedPartNumber = null;
this.AutoSelect();
},
AutoSelect() {
// Check if only a single part is present for the tint and set the v-model if it is.
if (this.partsForSelectedTint?.length == 1) {
@ -205,14 +197,22 @@ export default {
document.querySelector('input[value=' + this.selectedPartNumber + ']').checked = true;
});
},
// Loads the preselected values from the store.
LoadPreselectedValues() {
this.$nextTick(() => {
if (this.modelValue !== undefined) {
// Populate button-question model-value if parts data already exists in store
this.selectedTint = this.modelValue?.color;
// Populate button-question model-value if parts data already exists in store
if(this.modelValue)
{
this.selectedTint = this.modelValue.color;
}
});
else{
// If one item in list, select it
if (this.tintSelectionOptions?.length == 1) {
this.selectedTint = this.tintSelectionOptions[0].value;
}
}
});
},
},
watch: {

View file

@ -34,7 +34,6 @@
cmsWidgetName="SiteFooterWidget"
ref="siteFooter"
:isForwardActionDisabled="isForwardActionDisabled"
@tempButtonClicked="() => handleTempButtonClicked(this)"
@backClicked="navigateBack"
@ForwardClicked="forwardButtonAction" />
</div>