Custom tags are not displayed in the taglist

Hi! Custom tags added manually in the tag list field are not visible in that field after the page is refreshed.

Here is my field definition:

    classes:
        label: Classes
        type: taglist
        separator: comma
        mode: array
        customTags: true
        useKey: true
        options:
            bg01: Background color 1
            bg02: Background color 2
            bg03: Background color 3

I added a test tag:
image

After saving, I see the tag in the code:
sections[10][classes][] = "test"

However, after reloading the page, the tag is no longer visible in the field. So, after saving other changes, the tag will be removed from the code.

I know it is related to the useKey option, but if there is no label, can the key be treated as a label?

Hey @Radek !

There is actually code in v4 to address this scenario since it is problematic for integer keys.

// Keys cannot be used with custom tags
if ($this->customTags) {
    $this->useKey = false;
}

However you have highlighted a legitmate use case for it.