fix(01-03): resolve species/breed name directly from list in trigger — bypass Radix SelectValue bug
This commit is contained in:
1 parent
9d51003ece
commit
a0fdc0b9c4
1 file changed
+9
-7
@@ -225,7 +225,9 @@ export function PetForm({
|
||||
className="w-full"
|
||||
aria-invalid={!!errors.speciesId}
|
||||
>
|
||||
<SelectValue placeholder="Select species" />
|
||||
<span className={field.value ? "text-foreground" : "text-muted-foreground"}>
|
||||
{speciesList.find((s) => s.id === field.value)?.name ?? "Select species"}
|
||||
</span>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{speciesList.map((species) => (
|
||||
@@ -265,13 +267,13 @@ export function PetForm({
|
||||
className="w-full"
|
||||
disabled={!selectedSpeciesId}
|
||||
>
|
||||
<SelectValue
|
||||
placeholder={
|
||||
selectedSpeciesId
|
||||
<span className={field.value ? "text-foreground" : "text-muted-foreground"}>
|
||||
{field.value
|
||||
? (breedList.find((b) => b.id === field.value)?.name ?? "Select breed (optional)")
|
||||
: selectedSpeciesId
|
||||
? "Select breed (optional)"
|
||||
: "Select a species first"
|
||||
}
|
||||
/>
|
||||
: "Select a species first"}
|
||||
</span>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{breedList.length === 0 ? (
|
||||
|
||||
Reference in new issue
Block a user