Snippet forms are not rendering correctly when the default value is nothing "" or null – both of which used to be valid.
To Reproduce
Create the following snippet in frontmatter.json
"Quote":{"description":"Quote with author","body":["<blockquote>"," <p>[[quote]]</p>"," <figcaption>— [[author]], <cite><a href=\"[[&url]]\">[[cite]]</a></cite></figcaption>","</blockquote>"],"fields":[{"name":"quote","title":"Quote","type":"string","single":false,"default":"FM_SELECTED_TEXT"},{"name":"author","title":"Author","type":"string","single":true,"default":""},{"name":"cite","title":"Cite","type":"string","single":true,"default":""},{"name":"url","title":"Cite URL","type":"string","single":true,"default":""}]}
Expected behavior
The default: value should be able to be an empty value. Setting it to be "" or null or removed causes the form not to render.
Screenshots
Desktop (please complete the following information):
OS: MacOS
Vscodium: 1.86.2
Front Matter CMS: 10.0.0
**Describe the bug**
Snippet forms are not rendering correctly when the default value is nothing `""` or `null` – both of which used to be valid.
**To Reproduce**
Create the following snippet in frontmatter.json
``` json
"Quote": {
"description": "Quote with author",
"body": [
"<blockquote>",
" <p>[[quote]]</p>",
" <figcaption>— [[author]], <cite><a href=\"[[&url]]\">[[cite]]</a></cite></figcaption>",
"</blockquote>"
],
"fields": [
{
"name": "quote",
"title": "Quote",
"type": "string",
"single": false,
"default": "FM_SELECTED_TEXT"
},
{
"name": "author",
"title": "Author",
"type": "string",
"single": true,
"default": ""
},
{
"name": "cite",
"title": "Cite",
"type": "string",
"single": true,
"default": ""
},
{
"name": "url",
"title": "Cite URL",
"type": "string",
"single": true,
"default": ""
}
]
}
```
**Expected behavior**
The `default:` value should be able to be an empty value. Setting it to be `""` or `null` or removed causes the form not to render.
**Screenshots**
<img width="541" alt="Screenshot 2024-02-28 at 20 24 36" src="https://github.com/estruyf/vscode-front-matter/assets/411945/1e476097-7aaa-448c-b655-771fbe760894">
**Desktop (please complete the following information):**
- OS: MacOS
- Vscodium: 1.86.2
- Front Matter CMS: 10.0.0
<!-- github-sync-id:2159690840 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
Snippet forms are not rendering correctly when the default value is nothing
""ornull– both of which used to be valid.To Reproduce
Create the following snippet in frontmatter.json
Expected behavior
The
default:value should be able to be an empty value. Setting it to be""ornullor removed causes the form not to render.Screenshots
Desktop (please complete the following information):
Thanks for reporting this. A fix is on its way.
Version 10.0.1 has been published with the fix included.
@estruyf Thank you for the speedy fix. Just tested 10.0.1 and everything is working again 🙇