Jira SingleSelect

Hi i’m using the jira SingleSelect and i want to add the option to clear the select i tried to add allowClear: true but it doesn’t work so any suggestion ? Thank you

Atlassian’s select2 overrides styles of default select2. You may try to add these styles to show [x] element in the right side of select2 element.

/**
  This selector restyles default behaviour of select2 aui element
 */
.select2-container.aui-select2-container.select2-allowclear .select2-choice abbr {
    display: block !important;
}

/**
  This selector restyles default behaviour of select2 aui element
 */
.aui-select2-container .select2-choice abbr {
    padding-top: 10px;
    position: absolute;
    top: 5px !important;
}

Thank you for the reponse but the generated select don’t have the select2 classes
this is how i use the single select :
new AJS.SingleSelect({
element: item,
itemAttrDisplayed: “label”,
showDropdownButton: true,
ajaxOptions: {
url: url,
query: true,
dataType: ‘json’,
data: {
currentJQL: currentJql,
showAvatar: true,
showSubTasks: true
},
formatResponse: JIRA.IssuePicker.fn._formatResponse
}
});

and the result will be like this :

div class=“aui-ss ajax-ss aui-ss-select aui-ss-has-entity-icon” id=“id” data-query=""

Unfortunately, I have not seen docs of AJS.SingleSelect…

You may try select2 instead
https://aui.atlassian.com/aui/7.9/docs/auiselect2.html
https://select2.github.io/select2/

Ok thank you, for an intermediate solution i just added x icon next to the select to clear it.