Skip to content

I would like to be warned when a select setting's default value is not a valid option. #943

@charlespwd

Description

@charlespwd

Describe the solution you'd like
Writing this setting in a block/section/settings_schema.json should warn me that the default doesn't match the options.

  "settings": [
    {
      "type": "select",
      "id": "alignment",
      "default": "this-is-not-an-option", 
      "options": [
        { "value": "flex-start", "label": "t:options.alignment.left" },
        { "value": "center", "label": "t:options.alignment.center" },
        { "value": "flex-end", "label": "t:options.alignment.right" }
      ],
    },

Similarly, I'd like the presets to warn me as well if a setting value in a preset is not a valid option.

  "presets": [
    {
      "name": "t:general.column",
      "category": "t:general.layout",
      "settings": {
        "layout_direction": "group--vertical",
        "alignment": "this-is-not-an-option",
      }
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions