Skip to content

Select widget becomes empty when selecting an option with value 0 #6515

@lucadalli

Description

@lucadalli

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions