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

Error thrown when setting a date field to null #265

Open
aiscrim opened this issue Jan 18, 2022 · 1 comment
Open

Error thrown when setting a date field to null #265

aiscrim opened this issue Jan 18, 2022 · 1 comment
Labels

Comments

@aiscrim
Copy link

aiscrim commented Jan 18, 2022

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:

  1. Create form state with a date value
  2. Clear the date input
  3. See error in the console

Library version:
6.3.6

@aiscrim aiscrim added the bug label Jan 18, 2022
@Balastrong
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants