Coral UI select - empty value option | Community
Skip to main content
October 6, 2021
Solved

Coral UI select - empty value option

  • October 6, 2021
  • 1 reply
  • 1403 views

Hello,

 

I found out a small issue with Coral UI Select Field and I would like to share with you in case you will find yourself in a similar situation 🙂 

 

In my project there is a custom select field used on Asset Metadata schema which builds the Coral Select using JS API. One of the requirements was to provide one option which clears the value of that field (value is '' with label like `No value provided').

 

Unfortunately when I added the item using JS like

 

$dropdown[0].items.add({ value: '', selected: currentValue === value, content: { innerHTML: 'No value provided' } });

 

 

and option was added with content and value equal to `No value provided` so when I hit save on a dialog with field like that I end up with a value 'No value provided` saved as one of the properties of my resource. 

 

I see in the documentation (https://www.adobe.io/experience-manager/reference-materials/6-5/coral-ui/coralui3/Coral.Select.html#Coral.Select.Item:value) that 

 

 

Value of the item. If not explicitly set, the value of Node.textContent is returned.

 

In that case I have explicitly set the value and i want it to be an empty string which as far as I understand is currently considered as absence of the property and it's triggering the textContent as value of an option.

 

A workaround for that issue is to provide an empty innerHTML:

 

{ value: '', selected: false, content: { innerHTML: '' } }

 

 

Could you please advise where I could create a ticket to fix this or maybe document it better in the Coral UI ? 

 

Thanks 🙂 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kiran_Vedantam

Hi @bartek__w 

 

You can raise a support ticket by going to https://adminconsole.adobe.com/

 

https://experienceleague.adobe.com/docs/customer-one/using/home.html?lang=en#submit-ticket

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

1 reply

Kiran_Vedantam
Community Advisor
Kiran_VedantamCommunity AdvisorAccepted solution
Community Advisor
October 6, 2021

Hi @bartek__w 

 

You can raise a support ticket by going to https://adminconsole.adobe.com/

 

https://experienceleague.adobe.com/docs/customer-one/using/home.html?lang=en#submit-ticket

 

Hope this helps.

 

Thanks,

Kiran Vedantam.