feat(web/input): display value when no label is provided for select

This commit is contained in:
Luke
2022-06-11 11:59:00 +02:00
parent a7e2dc0067
commit 7b6cf6682f
3 changed files with 3 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ interface Props {
// type: "select", // type: "select",
// label: "Locker type", // label: "Locker type",
// options: [ // options: [
// { value: "option1", label: "Option 1" }, // { value: "option1" },
// { value: "option2", label: "Option 2" }, // { value: "option2", label: "Option 2" },
// { value: "option3", label: "Option 3" }, // { value: "option3", label: "Option 3" },
// ], // ],

View File

@@ -20,7 +20,7 @@ const SelectField: React.FC<Props> = (props) => {
</option> </option>
{props.row.options?.map((option, index) => ( {props.row.options?.map((option, index) => (
<option key={`option-${index}`} value={option.value}> <option key={`option-${index}`} value={option.value}>
{option.label} {option.label ? option.label : option.value}
</option> </option>
))} ))}
</Select> </Select>

View File

@@ -5,7 +5,7 @@ type RowType = "input" | "checkbox" | "select";
export interface Row { export interface Row {
type: RowType; type: RowType;
label: string; label: string;
options?: { value: string; label: string }[]; options?: { value: string; label?: string }[];
password?: boolean; password?: boolean;
icon?: IconProp; icon?: IconProp;
} }