Skip to content

First tag in a list of tags is not saved for multi-value dropdown filter #190

@madoni

Description

@madoni

Expected Behavior

All tags should be retained on saving the properties of an asset.

Actual Behavior

When a user opens the "Properties" page of an asset that's configured to use a multivalue dropdown filter, on hitting "Save" (or "Save and Close"), the first value from the dropdown field is removed from the asset metadata.

For example, if there are 3 values initially set for an asset, say "A", "B" and "C", on opening the properties page, these 3 values show up as tags below the multivalue dropdown field as expted. After saving (even without making any other changes) and reopening the "Properties" page, only two tags are visible "B" and "C".

The screenshot below shows that the input field associated with the first coral-tag is missing the value for the "value" attribute even though the "value" attribute of the coral-tag element itself is correctly set.

Coral Spectrum version

4.11.0

Sample Code that illustrates the problem (use the Playground if possible)

It seems that the coral-tag "value" is not correctly set when the tag is first created here: https://github.com/adobe/coral-spectrum/blob/master/coral-component-select/src/scripts/Select.js#L976

item._tag.set({ 
    value: item.value, 
    label: { 
        innerHTML: item.innerHTML 
    }
}, true); 

Replacing the second line in the code snippet above with the following fixes this issue:

value: itemValueFromDOM(item)

Screenshots (if applicable)

metadata-missing-issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions