ngrx-forms
ngrx-forms copied to clipboard
Error thrown when setting a date field to null
Describe the bug If a form contains a date field that was initialized with a date, and the user then clears that field, it is set to null. This makes the reducer throw an error at this line.
The error is:
ERROR TypeError: Cannot convert undefined or null to object
at Function.keys (
To Reproduce Steps to reproduce the behavior:
- Create form state with a date value
- Clear the date input
- See error in the console
Library version: 6.3.6
If you have a Date
object you might want to learn more about Value Conversion to let ngrx-forms handle it internally as a string, potentially avoiding your error.
Back to your specific issue, would be interesting to know how you handle the date (what HTML form element is displaying it) and how you clear the field (what value you see and how).