Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
charlespwd opened this issue May 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@charlespwd
Copy link
Contributor

charlespwd commented May 9, 2025

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",
      }
    },
@charlespwd charlespwd added the enhancement New feature or request label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant