mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
feat(web/input): display value when no label is provided for select
This commit is contained in:
@@ -37,7 +37,7 @@ interface Props {
|
||||
// type: "select",
|
||||
// label: "Locker type",
|
||||
// options: [
|
||||
// { value: "option1", label: "Option 1" },
|
||||
// { value: "option1" },
|
||||
// { value: "option2", label: "Option 2" },
|
||||
// { value: "option3", label: "Option 3" },
|
||||
// ],
|
||||
|
||||
@@ -20,7 +20,7 @@ const SelectField: React.FC<Props> = (props) => {
|
||||
</option>
|
||||
{props.row.options?.map((option, index) => (
|
||||
<option key={`option-${index}`} value={option.value}>
|
||||
{option.label}
|
||||
{option.label ? option.label : option.value}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
|
||||
@@ -5,7 +5,7 @@ type RowType = "input" | "checkbox" | "select";
|
||||
export interface Row {
|
||||
type: RowType;
|
||||
label: string;
|
||||
options?: { value: string; label: string }[];
|
||||
options?: { value: string; label?: string }[];
|
||||
password?: boolean;
|
||||
icon?: IconProp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user