-
Notifications
You must be signed in to change notification settings - Fork 110
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
Can't set form control to null using setValue update function #116
Comments
The line you mention should not be the bug since the state itself should never be null, just its value may be null. So the bug might be in the implementation of setValue. Could you please try the uncurried version, i.e. setValue(state, null).
|
Yes, I can use the uncurried version. As I am using setValue as part of an This would just be me currying the function myself (which is the workaround I am currently using) to avoid the error being thrown in the
I thought the whole point of the This is why I suggested checking for null like...
|
Ah yes, sorry, you are right. I didn't read your post carefully enough. Your proposed fix should work. I'll create a test and a fix for this today after work. Thanks for reporting this bug.
|
no worries, easily done. Thanks for the prompt reply! |
I've just released version 3.0.4 which contains a fix for this bug. |
version 3.0.3
Thanks for creating such a great library!
I am having trouble setting the value of a formControl to null.
According to the docs:
however when attempting to set the value of a control to null using the setValue update function i.e. setValue(null) the following error occurs.
when looking through the code it seems that this caused by
should there not be a null check on state or is there a better way of setting the value to null that I am unaware of?
The text was updated successfully, but these errors were encountered: