1 parent 324a1ee commit 779f84fCopy full SHA for 779f84f
1 file changed
src/components/dropdown.tsx
@@ -24,23 +24,14 @@ export const KeyValueDropdownComponent: React.FC<DropdownProps> = ({
24
}
25
};
26
27
- const current = defaultValue
28
- ? options.find((option) => option.value === defaultValue)?.label
29
- : "";
30
-
31
return (
32
<div>
33
- {/* defaultValue={current} doesn't work */}
34
<select value={defaultValue} onChange={handleChange}>
35
{options.map((option) => (
36
- <option
37
- key={option.value}
38
- value={option.value}
39
- selected={option.label == current}>
+ <option key={option.value} value={option.value}>
40
{option.label}
41
</option>
42
))}
43
- ;
44
</select>
45
</div>
46
);
0 commit comments