This commit is contained in:
Leah Schumann 2023-02-15 14:13:42 -05:00
parent 6b24f56a2b
commit 12bc2ec36f
3 changed files with 12 additions and 13 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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 @@
<textboxQuestion
cmsWidgetName="ApartmentNumberOrBusinessNameQuestionWidget"
v-model="addressModel.apartmentNumberOrBusinessName"
ref="apartmentNumberOrBusinessName"
inputId="639b0aaa35f64609ad6995f86a74322b"
disableAutoFill />
ref="apartmentNumberOrBusinessName" />
</div>
</div>
</transition>
@ -38,8 +36,6 @@
cmsWidgetName="CityQuestionWidget"
v-model="addressModel.city"
ref="city"
inputId="cbf28188fdf2436688fd735915f7ee56"
disableAutoFill
validationRules="city-required" />
</div>
</div>
@ -51,9 +47,7 @@
cmsWidgetName="StateQuestionWidget"
v-model="addressModel.state"
ref="state"
inputId="8fdf9dc2e13e430eb57529499dceb3eb"
:options="stateOptions"
disableAutoFill
validationRules="state-required" />
</div>
<div class="col">
@ -61,7 +55,6 @@
cmsWidgetName="ZipQuestionWidget"
v-model="addressModel.zipCode"
ref="zipCode"
inputId="01a9a1c2de0b4c9da8e023c9ae3be498"
mask="#####"
disableAutoFill
validationRules="zip-code-required|zip-code-format" />