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`).
This commit is contained in:
Jeppe Bundgaard
2026-04-13 18:02:06 +02:00
parent ce049d9196
commit 7d9d928a2d
@@ -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;
}
</style>
</style>