dadi / publish

Publish provides beautiful editorial interfaces for the management of content within API
https://dadi.cloud/en/publish
64 stars 13 forks source link

String select appear as '[object]' in list view #823

Closed mingard closed 4 years ago

mingard commented 4 years ago

Use this example field:

"vendor": {
      "type": "String",
      "label": "Payment Vendor",
      "required": false,
      "validation": {
        "regex": {
          "pattern": "[paypal|stripe]"
        }
      },
      "publish": {
        "multiple": false,
        "section": "Payment",
        "placement": "sidebar",
        "display": {
          "list": true,
          "edit": true
        },
        "options": [
          {
            "value": "paypal",
            "label": "Paypal"
          },
          {
            "value": "stripe",
            "label": "Stripe"
          }
        ]
      }
    }
  }

I presume that what it's doing is selecting the object from the list of options, but rendering the option rather than option.label

The logic is here https://github.com/dadi/publish/blob/develop/app/components/FieldString/FieldStringList.jsx#L79-L97