strapi-plugin-colorpicker icon indicating copy to clipboard operation
strapi-plugin-colorpicker copied to clipboard

Colorpicker not rendering on unpublished model

Open vitormarcelino opened this issue 3 years ago • 1 comments

Hello everyone, on my model, the colorpicker plugin isn't renderind on not published models, only after publish model the field is rendering on the screen. I need to select the color before the publish model, to consumer serve api with the colors selected.

Unpublished: image

Published: image

Anyone view this erros before? Thanks.

vitormarcelino avatar Jan 28 '22 02:01 vitormarcelino

If you're interested in workaround, the way to make component visible by default is specifying a default value of field in model. NB: you need to specify the default in stringified JSON, i.e.

{
  "color": {
      "type": "colorpicker",
      "columnType": "string",
      "required": true,
      "default": "{\"hex\":\"#00000000\",\"rgb\":{\"r\":0,\"g\":0,\"b\":0,\"a\":1},\"css\":\"rgba(0,0,0,0)\"}"
  }
}

bukhtiyarov-a-v avatar Mar 11 '22 09:03 bukhtiyarov-a-v