From 69b4c0c93c48a8ca4935b0f3b9e36a1cbf6a5d13 Mon Sep 17 00:00:00 2001 From: Fernando Terra Date: Tue, 16 Apr 2024 16:37:28 -0300 Subject: [PATCH 1/2] fix: validate autocomplete's selected value immediately --- frontend/src/components/forms/AutoCompleteInputComponent.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/forms/AutoCompleteInputComponent.vue b/frontend/src/components/forms/AutoCompleteInputComponent.vue index 6da592f9f7..672f47e265 100644 --- a/frontend/src/components/forms/AutoCompleteInputComponent.vue +++ b/frontend/src/components/forms/AutoCompleteInputComponent.vue @@ -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; }, From dc261497029d844f73254b15bb1822cb36268e86 Mon Sep 17 00:00:00 2001 From: Fernando Terra Date: Tue, 16 Apr 2024 16:53:28 -0300 Subject: [PATCH 2/2] chore: add stub data for manual testing --- .../stub/__files/response-address-G1V2W5.json | 15 +++++++++++++++ .../stub/__files/response-address-search-CA.json | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 frontend/stub/__files/response-address-G1V2W5.json diff --git a/frontend/stub/__files/response-address-G1V2W5.json b/frontend/stub/__files/response-address-G1V2W5.json new file mode 100644 index 0000000000..cf4e84aa13 --- /dev/null +++ b/frontend/stub/__files/response-address-G1V2W5.json @@ -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 +} \ No newline at end of file diff --git a/frontend/stub/__files/response-address-search-CA.json b/frontend/stub/__files/response-address-search-CA.json index ad40f4407b..24985aba6a 100644 --- a/frontend/stub/__files/response-address-search-CA.json +++ b/frontend/stub/__files/response-address-search-CA.json @@ -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" } ]