Netlify-cms: Default select widget value not populating via lists when adding new items

Created on 12 Jun 2019  路  2Comments  路  Source: netlify/netlify-cms

Describe the bug
Default select widget value not populating via lists when adding new items

To Reproduce via List Widget

  1. Click "Add list +"
  2. Notice the select field does not have the configured default value selected

To Reproduce via List Widget with Variable Types

  1. "Add variable list item" and then "Object"
  2. Notice the select field does not have the configured default value selected

Expected behavior
If a select field has a default value defined, it should be populated when a new list item is added that contains a select field with a defined default value.

Screenshots
netlify-cms-issue-select-widget-default

Applicable Versions:

  • Netlify CMS version: 2.9.0 via unpkg
  • Git provider: GitHub
  • OS: Mac OS 10.14.5 Mojave
  • Browser version: Chrome 74.0.3729.169
  • Node.JS version: v12.1.0

CMS configuration

fields:
  - label: "Select"
    name: "select"
    widget: "select"
    default: "default"
    options:
      - label: "Default"
        value: "default"
      - label: "Not Default"
        value: "not default"
  - label: "List"
    name: "list"
    widget: "list"
    fields:
      - label: "Select"
        name: "select"
        widget: "select"
        default: "default"
        options:
          - label: "Default"
            value: "default"
          - label: "Not Default"
            value: "not default"
  - label: "Variable List"
    name: "variableList"
    widget: "list"
    types:
      - label: "Object"
        name: "object"
        widget: "object"
        fields:
          - label: "Select"
            name: "select"
            widget: "select"
            default: "default"
            options:
              - label: "Default"
                value: "default"
              - label: "Not Default"
                value: "not default"

Most helpful comment

@madikarizma This issue hasn't been fixed yet, the PR is on its way.

All 2 comments

2374 should address this.

@madikarizma This issue hasn't been fixed yet, the PR is on its way.

Was this page helpful?
0 / 5 - 0 ratings