Feedback: Zero value shouldn't be treated as empty field #667

Closed
opened 2026-10-05 02:59:32 +02:00 by adam · 6 comments
Owner

image

When I set 0 to number field, it always treats as empty field. And if that field is required, it will reporting error. I don't think it is good design because in many cases, 0 has meaning. I suggest we should treat 0 like other digits and null/undefined as an empty field.

Info:

  • framework: Astro 4.15.1
     experimental: {
        contentLayer: true,
        contentIntellisense: true,
     },
    
  • os: Linux
  • vscode: 1.92.2
![image](https://github.com/user-attachments/assets/b096201d-ae6d-4859-9cce-11f27674cefd) When I set 0 to number field, it always treats as empty field. And if that field is required, it will reporting error. I don't think it is good design because in many cases, `0` has meaning. I suggest we should treat `0` like other digits and `null`/`undefined` as an empty field. Info: - framework: Astro `4.15.1` ``` experimental: { contentLayer: true, contentIntellisense: true, }, ``` - os: Linux - vscode: `1.92.2` <!-- github-sync-id:2500193574 -->
adam closed this issue 2026-10-05 02:59:32 +02:00
Author
Owner

Thanks @ngdangtu-vn for opening this issue. I have implemented a fix for this in the latest beta. Feel free to give it a try and let me know how it works.

Thanks @ngdangtu-vn for opening this issue. I have implemented a fix for this in the latest beta. Feel free to give it a try and let me know how it works. <!-- github-comment-id:2331350718 -->
Author
Owner

Cool, how do I test it?

Cool, how do I test it? <!-- github-comment-id:2331633523 -->
Author
Owner

You will have to uninstall or disable the stable version, and once that is done, you can install the beta: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta

You will have to uninstall or disable the stable version, and once that is done, you can install the beta: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter-beta <!-- github-comment-id:2331669517 -->
Author
Owner

Just tested, it works beautiful. Thanks!

Just tested, it works beautiful. Thanks! <!-- github-comment-id:2331721356 -->
Author
Owner

Thanks for verifying 🙏

Thanks for verifying 🙏 <!-- github-comment-id:2331807810 -->
Author
Owner

This functionality is now part of the v10.4.0 main release.

This functionality is now part of the `v10.4.0` main release. <!-- github-comment-id:2373238756 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#667