From 12bc2ec36fbb119d70c24f87a11c05abca2f5923 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 15 Feb 2023 14:13:42 -0500 Subject: [PATCH] WIP --- .../dropdown-question/dropdown-question.vue | 7 +++++-- .../textbox-question/textbox-question.vue | 7 +++++-- .../address-questions/address-questions.vue | 11 ++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index bdc36a0d8..c2e17926a 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -35,7 +35,7 @@ export default { name: "dropdown-question", props: { modelValue: String, - inputId: String, + //inputId: String, options: { type: Object, required: true, @@ -49,6 +49,8 @@ export default { placeHolderText: String, }, setup(props) { + const inputId = !props.customInputId ? `dropdown-${crypto.randomUUID()}` : props.customInputId; + const propsClone = Object.assign({}, props); const modelValue = propsClone.modelValue; let initialValue; @@ -69,12 +71,13 @@ export default { }; const { errorMessage, handleBlur, handleChange, meta, errors } = useField( - props.inputId, + inputId, props.validationRules, fieldOptions ); return { + inputId, errorMessage, handleBlur, handleChange, diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index 5fa93dc0c..8bccb9711 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -59,7 +59,7 @@ export default { default: true, }, modelValue: String, - inputId: String, + customInputId: String, isDisabled: Boolean, isRequired: Boolean, hasIcon: Boolean, // If input has an icon @@ -78,6 +78,8 @@ export default { includeSearchIcon: Boolean, }, setup(props) { + const inputId = !props.customInputId ? `input-${crypto.randomUUID()}` : props.customInputId; + const propsClone = Object.assign({}, props); const modelValue = propsClone.modelValue; let initialValue; @@ -98,12 +100,13 @@ export default { }; const { errorMessage, handleBlur, handleChange, meta, validate, errors } = useField( - props.inputId, + inputId, props.validationRules, fieldOptions ); return { + inputId, errorMessage, handleBlur, handleChange, diff --git a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue index aed1b5147..62099f2d9 100644 --- a/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue +++ b/src/layouts/address-lookup/customer-questions/address-questions/address-questions.vue @@ -7,7 +7,7 @@ cmsWidgetName="StreetAddressQuestionWidget" v-model="addressModel.streetAddress" ref="autocomplete" - inputId="autocomplete" + customInputId="autocomplete" placeholderText="Search" aria-haspopup="" hasIcon @@ -25,9 +25,7 @@ + ref="apartmentNumberOrBusinessName" /> @@ -38,8 +36,6 @@ cmsWidgetName="CityQuestionWidget" v-model="addressModel.city" ref="city" - inputId="cbf28188fdf2436688fd735915f7ee56" - disableAutoFill validationRules="city-required" /> @@ -51,9 +47,7 @@ cmsWidgetName="StateQuestionWidget" v-model="addressModel.state" ref="state" - inputId="8fdf9dc2e13e430eb57529499dceb3eb" :options="stateOptions" - disableAutoFill validationRules="state-required" />
@@ -61,7 +55,6 @@ cmsWidgetName="ZipQuestionWidget" v-model="addressModel.zipCode" ref="zipCode" - inputId="01a9a1c2de0b4c9da8e023c9ae3be498" mask="#####" disableAutoFill validationRules="zip-code-required|zip-code-format" />