Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Save' button does not enable on Form fields change #41

Closed
rizwanahmedziai opened this issue Dec 28, 2020 · 14 comments
Closed

'Save' button does not enable on Form fields change #41

rizwanahmedziai opened this issue Dec 28, 2020 · 14 comments
Labels
bug Something isn't working

Comments

@rizwanahmedziai
Copy link

rizwanahmedziai commented Dec 28, 2020

We have an issue where the 'Save' button does not enable when the field values are updated using the updated entity in state. Please see the attached Loom

https://www.loom.com/share/e1d84e207f414b70a88da261c6bf20df

Setting enableReinitialize = false shows the following error and 'same as insured' checkbox no longer works

Error

@SeanGroff
Copy link
Contributor

@rizwanahmedziai can you check if updating SQForm to the latest version resolves your issue? This sounds similar to the issue I resolved late last week.

@SeanGroff SeanGroff added question Further information is requested bug Something isn't working labels Dec 28, 2020
@rizwanahmedziai
Copy link
Author

@SeanGroff Updating SQForm to the latest version 2.0.2 did not resolve that issue.

@SeanGroff SeanGroff self-assigned this Jan 4, 2021
@AamirMaan
Copy link

I believe this bug is also related to the issue I am facing right now.
https://www.loom.com/share/b27b5abf4ed247bfabba869177638288

@rizwanahmedziai
Copy link
Author

rizwanahmedziai commented Feb 9, 2021

@SeanGroff Save button does not enable on state change. Please see the video
enableReinitialize set to true
SQForms version 2.11.0
https://www.loom.com/share/92f1fe467f804bc98e9ccbedb89b1ee6

@SeanGroff
Copy link
Contributor

@rizwanahmedziai @AamirMaan
Can we try updating SQForm to version 3.0.2 on your projects to see if this resolves the issue of the Save button not enabling when the form is reinitialized until a blur even occurs?

@AamirMaan
Copy link

@SeanGroff
I just tested by updating to version 3.0.2, the issue is still there, save button is not enabling when the form is reinitialized.

@SeanGroff
Copy link
Contributor

@SeanGroff

I just tested by updating to version 3.0.2, the issue is still there, save button is not enabling when the form is reinitialized.

Can you send me the Bitbucket link to the file this form resides?

@AamirMaan
Copy link

AamirMaan commented Feb 18, 2021

@SeanGroff
I just tested by updating to version 3.0.2, the issue is still there, save button is not enabling when the form is reinitialized.

Can you send me the Bitbucket link to the file this form resides?

Here https://bitbucket.org/SelectQuote/life-quote-tool/src/develop/client/src/containers/StepSections/PersonalAddresses/PersonalAddressModal.js

@codyarose
Copy link
Contributor

@rizwanahmedziai, @AamirMaan
Can you confirm that this issue is still present? I believe it may have been fixed in #171, which was included in v4.3.6

@AamirMaan
Copy link

@codyarose I am still facing this issue, here is the loom.
https://www.loom.com/share/75ac8c41e1da448da2d9676f0d1a37af

@codyarose
Copy link
Contributor

@codyarose I am still facing this issue, here is the loom.
https://www.loom.com/share/75ac8c41e1da448da2d9676f0d1a37af

Thank you for the update, I'll look more into this. I'm fairly sure we solved the same/a similar issue in the aforementioned PR, but perhaps the fix didn't propagate to the dialog form

@codyarose
Copy link
Contributor

I believe I was able to reproduce the issue in Storybook. It seems that disabling the initialErrors prop on Formik in SQFormDialog fixed the issue, but that also caused the save button to enable when it shouldn't have.

https://www.loom.com/share/742ab1aa6e51404c9382849dae1e297d

@SeanGroff It looks like you added that useInitialRequiredErrors hook. I looked into it, but I don't feel like I fully understand what it's doing - could you provide some insight on that? Seems like this issue hinges on what's going on with initialErrors.

@SeanGroff SeanGroff removed their assignment Oct 4, 2021
@SeanGroff
Copy link
Contributor

@codyarose Digging this issue up from the grave.
useInitialRequiredErrors is a work around for a bug inside Formik :(

I just checked the issue in the Formik repo and the commit that fixes the bug won't be merged until Formik v3.
Once Formik 3 is released and we can upgrade SQForm to Formik v3 we'll be able to remove useInitialRequiredErrors.

jaredpalmer/formik#2933

@codyarose
Copy link
Contributor

@SeanGroff
Gotcha. I figured this was one of those things that's a limitation of the library, so we'll have to wait for them to do something about it

@laurelbean laurelbean closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants