Skip to content

Commit

Permalink
fix(fe): validate autocomplete's selected value immediately (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
fterra-encora authored Apr 16, 2024
1 parent 7ceec2e commit e5141b5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/components/forms/AutoCompleteInputComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ watch(
inputValue.value = props.modelValue;
if (!isUserEvent.value && cdsComboBoxRef.value) {
cdsComboBoxRef.value._filterInputValue = props.modelValue || "";
// Validate the SELECTED value immediately.
validateInput(props.modelValue);
}
isUserEvent.value = false;
},
Expand Down
15 changes: 15 additions & 0 deletions frontend/stub/__files/response-address-G1V2W5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"streetAddress": "866 Liénard St",
"country": {
"value": "CA",
"text": "Canada"
},
"province": {
"value": "QC",
"text": "Quebec"
},
"city": "Québec",
"postalCode": "G1V 2W5",
"index": 0,
"locationName": null
}
4 changes: 4 additions & 0 deletions frontend/stub/__files/response-address-search-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,9 @@
{
"code": "B5V6L4",
"name": "9084 Concession Road 6 Charlottetown, QC, B5V 6L4"
},
{
"code": "G1V2W5",
"name": "866 Liénard St Québec, QC, G1V 2W5"
}
]

0 comments on commit e5141b5

Please sign in to comment.