File tree 2 files changed +13
-2
lines changed
src/components/overlays/Dialog
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @cube-dev/ui-kit ' : patch
3
+ ---
4
+
5
+ Postpone form reset in DialogForm until closing transition is over.
Original file line number Diff line number Diff line change @@ -85,7 +85,10 @@ export function DialogForm<T extends FieldTypes = FieldTypes>(
85
85
onDismiss ?.( ) ;
86
86
87
87
if ( ! preserve ) {
88
- form ?. resetFields ( ) ;
88
+ // let animations finish before resetting the form
89
+ setTimeout ( ( ) => {
90
+ form ?. resetFields ( ) ;
91
+ } , 250 ) ;
89
92
}
90
93
}
91
94
@@ -120,7 +123,10 @@ export function DialogForm<T extends FieldTypes = FieldTypes>(
120
123
onClose ?.( ) ;
121
124
122
125
if ( ! preserve ) {
123
- form ?. resetFields ( ) ;
126
+ // let animations finish before resetting the form
127
+ setTimeout ( ( ) => {
128
+ form . resetFields ( ) ;
129
+ } , 250 ) ;
124
130
}
125
131
} }
126
132
onSubmitFailed = { onSubmitFailed }
You can’t perform that action at this time.
0 commit comments