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

[BUG] Can not programatically set field value to null #82

Open
tbydza opened this issue May 10, 2022 · 0 comments
Open

[BUG] Can not programatically set field value to null #82

tbydza opened this issue May 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tbydza
Copy link
Contributor

tbydza commented May 10, 2022

I need to set field value programatically, but sometimes the value is null or undefined.

// example
const name = field('name', '');
name.set(null);

If I call set method with null parameter it causes this error:

TypeError: Cannot convert undefined or null to object

It is caused by const keys = Object.keys(field); in function isField .

Is it feature or bug?
I can work around it with this:

const fieldObj = get(name);
fieldObject.value = null;
name.set(fieldObj);

But it seems unnecessarily complicated.

@tbydza tbydza added the bug Something isn't working label May 10, 2022
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

2 participants