forked from github/plane
fix: focus getting removed from description while typing
This commit is contained in:
parent
6aaf9642bb
commit
855c65bc87
@ -132,7 +132,6 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
|
|||||||
control,
|
control,
|
||||||
getValues,
|
getValues,
|
||||||
setValue,
|
setValue,
|
||||||
setFocus,
|
|
||||||
} = useForm<IIssue>({
|
} = useForm<IIssue>({
|
||||||
defaultValues: prePopulatedData ?? defaultValues,
|
defaultValues: prePopulatedData ?? defaultValues,
|
||||||
reValidateMode: "onChange",
|
reValidateMode: "onChange",
|
||||||
@ -250,14 +249,12 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFocus("name");
|
|
||||||
|
|
||||||
reset({
|
reset({
|
||||||
...defaultValues,
|
...defaultValues,
|
||||||
...(prePopulatedData ?? {}),
|
...(prePopulatedData ?? {}),
|
||||||
...(data ?? {}),
|
...(data ?? {}),
|
||||||
});
|
});
|
||||||
}, [setFocus, prePopulatedData, reset, data]);
|
}, [prePopulatedData, reset, data]);
|
||||||
|
|
||||||
// update projectId in form when projectId changes
|
// update projectId in form when projectId changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -359,6 +356,7 @@ export const DraftIssueForm: FC<IssueFormProps> = (props) => {
|
|||||||
id="name"
|
id="name"
|
||||||
name="name"
|
name="name"
|
||||||
type="text"
|
type="text"
|
||||||
|
tabIndex={1}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
@ -46,15 +46,7 @@ const issueService = new IssueService();
|
|||||||
const moduleService = new ModuleService();
|
const moduleService = new ModuleService();
|
||||||
|
|
||||||
export const CreateUpdateDraftIssueModal: React.FC<IssuesModalProps> = observer((props) => {
|
export const CreateUpdateDraftIssueModal: React.FC<IssuesModalProps> = observer((props) => {
|
||||||
const {
|
const { data, handleClose, isOpen, prePopulateData: prePopulateDataProps, fieldsToShow = ["all"], onSubmit } = props;
|
||||||
data,
|
|
||||||
handleClose,
|
|
||||||
isOpen,
|
|
||||||
|
|
||||||
prePopulateData: prePopulateDataProps,
|
|
||||||
fieldsToShow = ["all"],
|
|
||||||
onSubmit,
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
// states
|
// states
|
||||||
const [createMore, setCreateMore] = useState(false);
|
const [createMore, setCreateMore] = useState(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user