decap-cms icon indicating copy to clipboard operation
decap-cms copied to clipboard

Select widget becomes empty when selecting an option with value 0

Open lucadalli opened this issue 2 years ago • 2 comments

Describe the bug The select widget allows true numbers (not numeric strings) to be stored by passing an array of { label: string, value: number } objects as the options parameter. However, when an option with a value of 0 is selected in the UI, the field becomes empty, likely due to some bug related to input validation. Since the field becomes empty, if the select is required, the entry cannot be saved, otherwise the value saves as null.

To Reproduce Create a select widget and add an option which has any label and a value of 0. Attempt to select that option via the UI

Expected behavior The option with a value of 0 is selected and its label is displayed

Applicable Versions:

  • Netlify CMS version: 2.10.192

lucadalli avatar Jul 17 '22 14:07 lucadalli

i would like to work on this issue. please assign it to me.

itssachinkr avatar Jan 12 '24 05:01 itssachinkr