File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## 4.59.1 ( May 7th, 2024)
2
+
3
+ ### Added
4
+
5
+ - Extra debug logging for reset
6
+
1
7
## 4.59.0 ( May 7th, 2024)
2
8
3
9
### Added
Original file line number Diff line number Diff line change @@ -1234,8 +1234,11 @@ export class FormController {
1234
1234
}
1235
1235
1236
1236
reset ( options = { } ) {
1237
+ debug ( 'Resetting Form' ) ;
1238
+
1237
1239
// There are cases where we dont want to blow away all the form values
1238
1240
if ( this . options . current . resetOnlyOnscreen ) {
1241
+ debug ( 'Resetting only onscreen inputs' ) ;
1239
1242
this . state . initialValues = this . options . current . initialValues ?? { } ;
1240
1243
this . fieldsMap . forEach ( fieldMeta => {
1241
1244
fieldMeta . current . fieldApi . reset ( { resetValue : resetValues } ) ;
@@ -1270,6 +1273,7 @@ export class FormController {
1270
1273
} ;
1271
1274
1272
1275
this . fieldsMap . forEach ( fieldMeta => {
1276
+ debug ( `Resetting the field, ${ fieldMeta . current . name } ` ) ;
1273
1277
fieldMeta . current . fieldApi . reset ( { resetValue : resetValues } ) ;
1274
1278
} ) ;
1275
1279
Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ export const useForm = ({
206
206
// If the form is pristine then reset it when we get new initial values !
207
207
const { pristine } = formApi . getFormState ( ) ;
208
208
if ( pristine ) {
209
+ logger (
210
+ 'Resetting entire form as form is pristine and we got new initial values'
211
+ ) ;
209
212
formApi . reset ( ) ;
210
213
}
211
214
} ,
You can’t perform that action at this time.
0 commit comments