simulate click event on radio button to fix undefined value

This commit is contained in:
Kroell 2023-04-10 16:20:39 -04:00
parent e45765a8ad
commit 86a0ba4621

View file

@ -182,16 +182,16 @@ export default {
return tintSourceObject.src; return tintSourceObject.src;
}, },
// Check if only a single part is present for the tint and set the v-model if it is.
AutoSelect() { AutoSelect() {
if (this.partsForSelectedTint?.length > 0) if (this.partsForSelectedTint?.length > 0)
{ {
// Check if only a single part is present for the tint and set the v-model if it is.
if (this.partsForSelectedTint?.length == 1) { if (this.partsForSelectedTint?.length == 1) {
this.selectedPartNumber = { value: this.partsForSelectedTint[0].partNumber }; this.selectedPartNumber = { value: this.partsForSelectedTint[0].partNumber };
//select element with matching partNumber //select element with matching partNumber
this.$nextTick(() => { this.$nextTick(() => {
document.querySelector('input[value=' + this.selectedPartNumber + ']').checked = true; document.querySelector('input[value=' + this.selectedPartNumber + ']').click();
}); });
} }
else { else {