specific-silverS
Refine3y ago
24 replies
specific-silver

Edit Pre-population Based On ID

Hi! Smaller issue, hope thats okay. I have a dropdown similar to

<Form.Item name="LocationID" >
    <Select
        allowClear
        placeholder={"Select"}
        options={[
            {
                label: "New York",
                value: '1',
            },
            {
                label: "Los Angeles",
                value: '2',
            },
            {
                label: "San Francisco",
                value: '3',
            }
        ]}
    />
</Form.Item>


However, when the form is being prepopulated with data, the label is "1" rather than the expected "New York".

Is there any way I can avoid this and prepopulate based on value?
Was this page helpful?