Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
madoni opened this issue Nov 22, 2021 · 0 comments
Open

Comments

@madoni
Copy link

madoni commented Nov 22, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant