Parcourir la source

fix: resolve state label when edit form presets state by id only

The user edit form assigns `form.state = { value: state_id }` before the
select finishes loading its options. `selectStateById` bailed out early
because the ids already matched, leaving the model without a `label`, so
the field rendered "[object Object]".

Now the early return also requires a resolved label.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TAqjSV3BQ6Q6hsfyRPiwpq
alvesantos il y a 2 jours
Parent
commit
36bbd92731
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/components/selects/StateSelect.vue

+ 1 - 1
src/components/selects/StateSelect.vue

@@ -77,7 +77,7 @@ const filterFn = (val, update) => {
 };
 
 const selectStateById = async (id) => {
-  if (selectedState.value?.value === id) return;
+  if (selectedState.value?.value === id && selectedState.value?.label) return;
   selectedState.value = baseOptions.value.find((state) => state.value === id);
 };