fix: focus getting removed from description while typing

This commit is contained in:
dakshesh14 2023-11-06 13:31:04 +05:30
parent 6aaf9642bb
commit 855c65bc87
2 changed files with 3 additions and 13 deletions

View File

@ -132,7 +132,6 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
control,
getValues,
setValue,
setFocus,
} = useForm<IIssue>({
defaultValues: prePopulatedData ?? defaultValues,
reValidateMode: "onChange",
@ -250,14 +249,12 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
};
useEffect(() => {
setFocus("name");
reset({
...defaultValues,
...(prePopulatedData ?? {}),
...(data ?? {}),
});
}, [setFocus, prePopulatedData, reset, data]);
}, [prePopulatedData, reset, data]);
// update projectId in form when projectId changes
useEffect(() => {
@ -359,6 +356,7 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
id="name"
name="name"
type="text"
tabIndex={1}
value={value}
onChange={onChange}
ref={ref}

View File

@ -46,15 +46,7 @@ const issueService = new IssueService();
const moduleService = new ModuleService();
export const CreateUpdateDraftIssueModal: React.FC<IssuesModalProps> = observer((props) => {
const {
data,
handleClose,
isOpen,
prePopulateData: prePopulateDataProps,
fieldsToShow = ["all"],
onSubmit,
} = props;
const { data, handleClose, isOpen, prePopulateData: prePopulateDataProps, fieldsToShow = ["all"], onSubmit } = props;
// states
const [createMore, setCreateMore] = useState(false);