-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code
Description
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 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.
Screenshots
Applicable Versions:
- Decap CMS version: 3.1.1
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.
weeix
Metadata
Metadata
Assignees
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code