File tree Expand file tree Collapse file tree
src/components/overlays/Dialog Expand file tree Collapse file tree 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>(
8585 onDismiss ?.( ) ;
8686
8787 if ( ! preserve ) {
88- form ?. resetFields ( ) ;
88+ // let animations finish before resetting the form
89+ setTimeout ( ( ) => {
90+ form ?. resetFields ( ) ;
91+ } , 250 ) ;
8992 }
9093 }
9194
@@ -120,7 +123,10 @@ export function DialogForm<T extends FieldTypes = FieldTypes>(
120123 onClose ?.( ) ;
121124
122125 if ( ! preserve ) {
123- form ?. resetFields ( ) ;
126+ // let animations finish before resetting the form
127+ setTimeout ( ( ) => {
128+ form . resetFields ( ) ;
129+ } , 250 ) ;
124130 }
125131 } }
126132 onSubmitFailed = { onSubmitFailed }
You can’t perform that action at this time.
0 commit comments