[Fixed] How to set default value of String List in a Custom Component to []

What I’m trying to do:
Set the default value of a custom component’s property that is of type String list to [] rather than [‘’].

What I’ve tried and what’s not working:

  1. I’ve tried not inputting anything in the default value in the designer.
  2. I’ve tried going into the yaml of the component locally by downloading the git repo, only to find that it’s already set to []!

image

So I guess this is a bug that when the default value of String List is set to [] it comes back as [‘’].

Yes that is a bug.
Coincidently I found the same thing a couple of days ago and so there’s already a fix ready to go.

It’s not actually the default value that’s the issue
if you do a search for "curriclum_items" in your app locally
you’ll probably find something like

properties: {..., curriculum_items: [''], ...}

(this happens when you touch the property in the designer)

2 Likes

That worked great to fix it for my one use of it :slight_smile: Thanks!