I want an element to be removed from the list by clicking on it in the selectize-dropdown-content So that the elements do not disappear after adding from the list, I used hideSelected: false, The click event doesn't work on this elements, I can't catch it
The problem is that after my code works and the element is removed, onItemAdd immediately works and it is added to the list again)
I have this code:
$(document).on('mousedown',function (e){
if ($(e.target).hasClass('option') && $(e.target).hasClass('selected')){
var value = $(e.target).attr("data-value");
var control = $(e.target).parents('.selectize-control').siblings('.selectized')[0].selectize;
control.removeItem(value);
control.refreshItems();
control.refreshOptions();
}
});
i tried to catch click events or something but they don't apply to these elements
Via Active questions tagged javascript - Stack Overflow https://ift.tt/8jkC3iR
Comments
Post a Comment