From 7d9d928a2da4075258be545c9de2d250d4509639 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Mon, 13 Apr 2026 18:02:06 +0200 Subject: [PATCH] Normalize license plate input value handling in `LicensePlateInput.vue`: - Ensured input field values are updated consistently with `props.actualValue`. - Replaced raw `newValue` usage with normalized string values for better data integrity. - Improved checks for synchronization and validation logic (`checkLicensePlateValid`, `searchCustomerRegistrationNumbers`). --- .../department/pos/input/LicensePlateInput.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/forms/department/pos/input/LicensePlateInput.vue b/src/components/forms/department/pos/input/LicensePlateInput.vue index afecea7b..4366c279 100644 --- a/src/components/forms/department/pos/input/LicensePlateInput.vue +++ b/src/components/forms/department/pos/input/LicensePlateInput.vue @@ -257,12 +257,16 @@ const isDropdownItemSelected = (registrationNumber) => { const inputField = ref(null); watch(() => props.actualValue, (newValue) => { - if (newValue === currentFieldVal.value) { + const normalizedValue = String(newValue ?? ''); + if (inputField.value && inputField.value.value !== normalizedValue) { + inputField.value.value = normalizedValue; + } + if (normalizedValue === currentFieldVal.value) { return; } - currentFieldVal.value = newValue; - checkLicensePlateValid(newValue); - searchCustomerRegistrationNumbers(newValue); + currentFieldVal.value = normalizedValue; + checkLicensePlateValid(normalizedValue); + searchCustomerRegistrationNumbers(normalizedValue); }); const onChangeReg1 = () => { @@ -398,4 +402,4 @@ const getCurrentIconColor = () => { .input.has-sharp-edges { border-radius: 0; } - \ No newline at end of file +