Skip to content

Select.Item value={1} issue #726

Open
@AMDarter

Description

@AMDarter

I noticed that when Select.Item value={1} then the item is not selected. My assumption is that it registers as bool. As soon as I convert to String it is fine.

<Select.Item key={opt.value} value={String(opt.value)}>
<Select.Root
    key={field.name}
    value={data[field.name]}
    name={field.name}
    onValueChange={(value) => setData(field.name, value)}
>
    <Select.Trigger placeholder={field.placeholder} />
    <Select.Content>
        {field.options.map((opt) => (
            <Select.Item key={opt.value} value={opt.value}> // Registers as bool for int 1?
                <span className="capitalize">{opt.label}</span>
            </Select.Item>
        ))}
    </Select.Content>
</Select.Root>

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions