Dirty since last submit
Howdy! After a sidequest at work, I'm back to the migration from React Final Form (RFF) to TS Form. It's going well (although the draft PR with the field wrapper example would be great, so I can make use of
DeepKeyValue and all that), but I've got a new roadblock.
RFF keeps track of the dirty state as a whole, but also since the last submit (dirty and dirtySinceLastSubmit), which is an absolute necessity for our saving indicator that gets used for our autosaving forms.
I tried to convert our saving indicator, but it's not possible without some way of identifying whether a field is modified. isSubmitted and isDirty don't get cleared once the field becomes dirty again.
The only difference between my TS Form indicator and my RFF indicator is the field meta used. Here's my mapping from RFF to TS Form
- field.meta.modified -> field.meta.isDirty
- field.meta.submitFailed -> field.meta.errorMap.onSubmit
- field.meta.submitting -> form.store.isSubmitting
- field.meta.dirtySinceLastSubmit -> form.store.isSubmitted
My question is: is there any scope for dirtySinceLastSubmit in TS Form?2 Replies
manual-pinkOP•15mo ago
For reference, here's a excalidraw diagram of the interaction flow

manual-pinkOP•14mo ago
It appears I'm not the sharpest tool in the shed.
RFF
field.meta.modified can be replicated with the following 2 lines