Skip to content

Commit 9a3fd69

Browse files
committed
PM-691
1 parent e075d19 commit 9a3fd69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/ProjectForm/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const ProjectForm = ({
2222
register,
2323
handleSubmit,
2424
control,
25-
formState: { errors }
25+
reset,
26+
formState: { isDirty, errors }
2627
} = useForm({
2728
defaultValues: {
2829
projectName: isEdit ? projectDetail.name : '',
@@ -65,6 +66,7 @@ const ProjectForm = ({
6566
console.error(err)
6667
} finally {
6768
setIsSaving(false)
69+
reset(data)
6870
}
6971
}
7072

@@ -155,7 +157,6 @@ const ProjectForm = ({
155157
options={projectTypeOptions}
156158
id='projectType'
157159
{...field}
158-
isClearable
159160
placeholder='Select Project Type'
160161
/>
161162
)}
@@ -238,7 +239,7 @@ const ProjectForm = ({
238239
text={isSaving ? 'Saving...' : 'Save'}
239240
type={'info'}
240241
submit
241-
disabled={isSaving}
242+
disabled={isSaving || !isDirty}
242243
/>
243244
</div>
244245
</form>

0 commit comments

Comments
 (0)