You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before I start hacking around an onChange handler, I was wondering if there's a better way.
I have a form where a segment can be removed and regenerated if one of four dropdowns changes; I don't know if it helps, but this image illustrates it: https://imgur.com/a/sIvSkPa
That is, if the user changes the Input AVP Set, Output AVP Set, or one of the Applies To dropdowns, the section "Events" is regenerated (since each entry depends on the contents of the selected Input / Output file).
Anyway that aside. Since data can be lost when those Events are regenerated, I'd like to add a confirmation if the number of events is > 0 and one of those four dropdowns is changed. I'd also like to add a confirmation if the right-hand dropdown of one of those Events changes.
Is there a convenient way of doing this? Or should I plug into onChange() myself, going around formik, and use setFieldValue() if the user confirms?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
Before I start hacking around an onChange handler, I was wondering if there's a better way.
I have a form where a segment can be removed and regenerated if one of four dropdowns changes; I don't know if it helps, but this image illustrates it: https://imgur.com/a/sIvSkPa
That is, if the user changes the Input AVP Set, Output AVP Set, or one of the Applies To dropdowns, the section "Events" is regenerated (since each entry depends on the contents of the selected Input / Output file).
Anyway that aside. Since data can be lost when those Events are regenerated, I'd like to add a confirmation if the number of events is > 0 and one of those four dropdowns is changed. I'd also like to add a confirmation if the right-hand dropdown of one of those Events changes.
Is there a convenient way of doing this? Or should I plug into
onChange()
myself, going around formik, and usesetFieldValue()
if the user confirms?Beta Was this translation helpful? Give feedback.
All reactions