question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

null converted to "value"

See original GitHub issue
form.$('people').set([
  { name: null },
  { name: null },
  { name: null },
])

Results in values being converted from null to "value" Shouldn’t it (if anything) convert to an empty string?

And there is another bug, only the first object is being copied!

form.values()
{
  people: [{ name: "value" }]
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
foxhound87commented, Feb 22, 2017

Yes, the update() method needs a change, I will make it.

‘set()’ should fill only the existent fields.

0reactions
liveresumecommented, Feb 21, 2017

The null value conversion has been fixed, however there are still 2 issues:

form.$('people').set([
    { name: null },
    { name: null },
    { name: null },
  ]);

Only sets the first field.

And the same but with update() does not do anything at all!

form.$('people').update([
    { name: null },
    { name: null },
    { name: null },
  ]);

However calling it on form works fine: form.update({ jobs: res })

I need it to also work on a selected child, please allow for something like: form.$('people').update([...])

Read more comments on GitHub >

github_iconTop Results From Across the Web

A function to convert null to string - Stack Overflow
I want to create a function to convert any null value e.g. from a database to an empty string. I know there are...
Read more >
How null is converted to Number in JavaScript? - Tutorialspoint
The Number() method in JavaScript is used to convert a value into a number. If the value is not convertible, then it will...
Read more >
Convert to/from NULL value in Database - OutSystems
When retrieving data from the database, the null value is converted to the attribute's default value. If no default value is defined for...
Read more >
ValueConverter.ConvertsNulls Property - Microsoft Learn
If true, then the nulls will be passed to the converter for conversion. Otherwise null values always remain null.
Read more >
Solved: We cannot convert the value null to type Logical.
Solved: Hi there, I am trying to create a conditional column based on another column. When I created a conditional column, I got...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found