-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
-
I have an existing select which I have just selectized.
I use Ajax which is triggered when an item in the select list is selected. $('#saleCatFilter').change();
When I select an item everything works as expected except when I am trying to apply a blur() or focus() event.
$saleCatFilter = $("#saleCatFilter").selectize({
plugins: ['remove_button'],
placeholder: 'All Sale Categories',
closeAfterSelect: true,
onChange: function(value) {
$saleCatFilter.blur();
},
onItemRemove: function(value) {
$saleCatFilter.close();
$saleCatFilter.focus();
}
});
-
When I select an item with closeAfterSelect: true, the focus remains inside the element which means that a new click in the element does not trigger the dropdown. Therefore, I added onChange: blur() to try and remove the focus but the focus remains.
-
When I remove all items from the list, the select field height collapses with NO placeholder displayed. It's not until I click back into the field that the field returns to its original height and the placeholder appears again. I tried adding onItemRemove: focus() to reset the placeholder but that is not working either.
Beta Was this translation helpful? Give feedback.