Radio does not accept null values (similar for checkbox & select)
See original GitHub issueDescribe the bug
When using null
values in options
-prop, the inputs fallback to HTML default behavior as if no value was set.
I would actually expect, that null
can be used as value if explicit defined.
Maybe I’m expecting too much here, since null
is not a typical value for HTML elements, but from the JS perspective I’d rather expect null
than “on”.
Reproduction https://formkit.link/b6a5c9100aff1f93c43b99a50962fefe
Desktop (please complete the following information):
- OS: Mac 11.6.2
- Browser: Chrome 98.0.4758.80
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Radio buttons vs checkboxes for true/false/null options
My first choice was using two radio buttons which would read "Yes" and "No", but the problem with radio buttons is that they...
Read more ><input type="checkbox"> - HTML: HyperText Markup Language
A Boolean attribute indicating whether this checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is ......
Read more >Screen Flow hidden Checkbox does not evaluate to true for ...
When the checkbox component is hidden, its value should be null and we should be able to use its value in the visibility...
Read more >Add a check box control to show Yes/No values
In Access, a Yes/No field stores only two values: Yes or No. If you use a text box to display a Yes/No field,...
Read more >Ultimate Guide: Pardot Field Sync Behavior & Null Value Sync
Which platform should be the source of truth? I show you how Pardot Field Sync Behavior and Null Value Sync work between Pardot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fair question. Vue is actually the thing making this work the way it does since it sees the
null
(andundefined
) as a no op attribute value.I dont think it is asking too much however — one of the goals of this project is to smooth out some of those inconsistencies and make things “just work”.
@lavolpecheprogramma new issues are generally good for new bugs, but thats one is not a bug — lists must explicitly have array values. An new list will set its own value to an array, but if the list is told to set its value to undefined or null that error will be raised.