Jira dialog submit button gets disabled automatically if an error occurs in form


I have a webwork item in opsbar that opens JIRA dialog. I am embedding a react project inside of it. I am using antd form for my fields. When a required rule is triggered, submit button becomes disabled. It does not even get enabled if I enter the required fields.

button group for the dialog:

             isIssueView ?
                <div className="buttons-container form-footer">
                    <div className="buttons">
                        <input accessKey="s" className="button" id="reset-issue-proceed" name="Proceed"
                               title="Press Ctrl+Alt+S to submit this form" type="submit" value={intl.formatMessage({...messages.muteSla.buttons.done})} />
                        <a accessKey="`" className="cancel" href={cancelHref}
                           id="undo-reset-issue-cancel" title="Press Ctrl+Alt+` to cancel">
                : null

I could not add the first image because of the community rules.

submit button becomes disabled after submitted invalid form:

I realized that other dialogs have the same problem, too. Actually, this may be a behavioral thing I am not sure about because there is a lack of information. However, I found a workaround and wanted to share those who might be facing the same problem in the future. In antd form, there is an attribute called onFinishFailed and it gets triggered if any validation error occurs. So, I have added the below code snippet to remove the disabled attribute after it’s added.

onFinishFailed={() => setTimeout(doneButtonRef.current?.removeAttribute("disabled"), 500)}