You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a text/image widget is required: false, removing the existing value of the widget would left an empty string value, rather than undefined or null.
To Reproduce
Define an optional text/image widget
fields: # The fields for each document, usually in front matter
- {label: 'Excerpt', name: 'excerpt', widget: 'text', required: false}
- {label: 'Image', name: 'photos', widget: 'image', required: false}
Create a post with the widgets edited
Edit the post again to delete the value of the widgets
The field of two widgets left in the generated markdown file with empty strings:
excerpt: ""
photos: ""
Expected behavior
Remove the fields completely if the widget is optional and empty.
Describe the bug
If a text/image widget is
required: false
, removing the existing value of the widget would left an empty string value, rather thanundefined
ornull
.To Reproduce
Expected behavior
Remove the fields completely if the widget is optional and empty.
Screenshots
Applicable Versions:
CMS configuration
Additional context
This bug is issued in #995, #2007, #2848, #1449, #2017. As replied #995 (comment), seems this bug should be fixed since 3.0.0.
The text was updated successfully, but these errors were encountered: