Hi, community. I have strange behavior when I create AJS.SingleSelect
const options = {
element: input,
errorMessage: "",
removeOnUnSelect: false,
itemAttrDisplayed: "label",
ajaxOptions: {
url: AJS.contextPath() + "/rest/api/2/role",
query: true,
formatResponse: function (response) {
let roles = [];
response.forEach(function (role, i) {
AJS.log(roles);
AJS.log(i);
let item = new AJS.ItemDescriptor({
value: role.id,
label: role.name,
title: role.name,
html: role.html,
highlighted: true
});
roles.push(item);
});
return roles;
}
}
};
new AJS.SingleSelect(options);
a Single Select is created, but when selecting values, the old values are not deleted
I tried change removeOnUnSelect from false to true but didn't help
But if I change /rest/api/2/role to /rest/api/2/project its work