question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dirty handling workflow

See original GitHub issue

Trying to implement a workflow as follows:

Users sees a pristine form, save button is hidden => user begins typing in input, form becomes dirty, save button is shown => user saves, form becomes pristine, save button is hidden

Is this currently possible in formik? dirty is remaining as false for me up until the form submitted and is never reset afterwards

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

14reactions
insidewhycommented, Apr 15, 2020

Was really surprised to learn that dirty means “different to initial values” rather than “different to submitted values” as in every other form library I’ve used. I tried to resetValues to the submitted values, and that cleared every single input in my form. Argh.

3reactions
jaredpalmercommented, Oct 5, 2017

validateOnChange and validateOnBlur are true by default in 0.9.2, but I don’t think I considered how it might impact the the meaning of dirty. I want to have a larger conversation about pristine / dirty, but this PR would allow you to check the equality of initialValues with current values, while not making a breaking change.

// if values is flat
{props.values !== props.initialValues &&
  <button type="submit">Save</button>
}

// otherwise
{!isEqual(props.values, props.initialValues) &&
  <button type="submit">Save</button>
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

5 ways to design a better infection control workflow
Effective infection control workflows require forethought and an ... “You always want to move from dirty to clean and not backtrack.
Read more >
Yoshikura, Workflow from Clean to Dirty, HACCP - Niid
I propose the use of a principle of workflow from clean to dirty in all infection control practices. "Clean" means an area free...
Read more >
Instrument Processing Workflow - Midmark
This design can help staff keep the process moving using a linear flow from dirty to clean while also keeping everything within reach....
Read more >
A Quick and Dirty Guide to Creating Approval Workflows
A Quick and Dirty Guide to Staffing a Content Team and Creating Approval Workflows. By Joe Lazer. Reading time: 5 min.
Read more >
Why Use Workflow Management Systems? - Kissflow
Workflow Management System helps to automate repetitive manual processes to help ... Without a sturdy bridge or even a dirt road to connect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found