Dropdown Search Default Item is Selectable

The Outsystems UI Dropdown Search appears too prepend a "Select an Item" to the dropdown list. This item is selectable . This seems like a mis-step since it could lead to null items being selected if not properly null checked. Is there a reason this item is not styled so that it is not clickable?

Hovering over this reveals a pointer and it can trigger the onclick action of the widget.

Solution

Hello @Andrew Mitchell 

Good question. My 2 cents, the Dropdown Search widget is based on choices.js and while I cannot say for sure why the logic works the way it does out of the box, you may counter the behavior by implementing the following css:

.choices__list--dropdown .choices__placeholder{
    display:none;
}

This way though you will see the default placeholder text 'Select an item' ...

it will no longer be selectable i.e it will not trigger the OnSelect event and will only allow selection of the list values:

Hope this helps some,

Regards,

AJ

Solution

Hello @Andrew Mitchell 

Good question. My 2 cents, the Dropdown Search widget is based on choices.js and while I cannot say for sure why the logic works the way it does out of the box, you may counter the behavior by implementing the following css:

.choices__list--dropdown .choices__placeholder{
    display:none;
}

This way though you will see the default placeholder text 'Select an item' ...

it will no longer be selectable i.e it will not trigger the OnSelect event and will only allow selection of the list values:

Hope this helps some,

Regards,

AJ

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.