File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
epictrack-web/src/components/project Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export default function ProjectForm({ ...props }) {
86
86
control,
87
87
formState : { errors } ,
88
88
reset,
89
+ setValue,
89
90
} = methods ;
90
91
const formValues = useWatch ( { control } ) ;
91
92
@@ -147,6 +148,10 @@ export default function ProjectForm({ ...props }) {
147
148
Promise . all ( promises ) ;
148
149
} , [ ] ) ;
149
150
151
+ const typeChange = ( ) => {
152
+ setValue ( "sub_type_id" , undefined ) ;
153
+ } ;
154
+
150
155
const onSubmitHandler = async ( data : any ) => {
151
156
ctx . onSave ( data , ( ) => {
152
157
reset ( ) ;
@@ -241,6 +246,7 @@ export default function ProjectForm({ ...props }) {
241
246
< Grid item xs = { 6 } >
242
247
< ETFormLabel required > Type</ ETFormLabel >
243
248
< ControlledSelectV2
249
+ onHandleChange = { typeChange }
244
250
placeholder = "Select"
245
251
key = { `type_select_${ formValues . type_id } ` }
246
252
helperText = { errors ?. type_id ?. message ?. toString ( ) }
You can’t perform that action at this time.
0 commit comments