specific-silverS
Refine3y ago
5 replies
specific-silver

Using a Form.Item Clears other Form.items

Utterly confused as to what's happening. I have the given form:

<Form {...formProps} layout="vertical" onFinish={handleFinish}>
                <Form.Item
                    label="Product"
                    name={"productID"}
                    rules={[
                        {
                            required: true,
                        },
                    ]}
                >
                    <Select options={selectProductOptions}/>
                </Form.Item>
                <Form.Item
                    label="Quantity"
                    name={["quantity"]}
                    rules={[
                        {
                            required: true,
                        },
                    ]}
                >
            </Form>


Where formProps is coming from:

const {
        modalProps,
        formProps,
        show,
    } = useModalForm({
        action: "create",
        resource: "products",
        redirect: false
    })


Selecting something from the products dropdown will clear the quantity input, while typing something in the quantity input will clear the products dropdown.

It was working fine before, so I'm confused as to why it's decided to stop. Any pointers to possible reasons this could be happening would be really appreciated
Was this page helpful?