I am using antd library in my project and using Form from antd. Whenever I focus on any input field in that form, it auto scrolls to bottom of that form. I want to disable this scroll while focusing on input fields. The form somewhat looks like below:
<Form
form={form}
name="seller_contact_form"
initialValues={props.initialValues}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
scrollToFirstError
autoComplete="dontshow"
>
<Row justify="center">
<Col span={20}>
<div className="gq-order-quantity-wrap">
<span className="label-paragraph">
Preferred quantity
</span>
</div>
<Form.Item
name="quantity"
style={{ marginBottom: "1em" }}
rules={[
{
required: true,
message: "Please enter target quantity",
},
{
min: parseInt(inStock <= 0 ? switchMoq : minimumOrderQuantity),
type: "number",
message:
`Please add quantity equal units`,
},
{
pattern: new RegExp("^[0-9]*$"),
message: "Please enter in correct format!",
},
]}
>
<InputNumber
onFocus={(e) => gtmFormFunction("quantity", e)}
onChange={(value) => checkQuantityVal(value)}
autoComplete="dontshow"
id={`quantity_${generateRandomString()}`}
className={'input112'}
/>
</Form.Item>
Please suggest if anyone got any clue on how to fix this. Thanks in advance :)