Open
Description
Trying to "clear" select field after an option is selected, by selecting another option right after it (with empty value in this case), results in onChange event running twice in Firefox (only). Same with selecting any option not just empty one. It works as expected in Chrome, Edge & Safari, where it runs only once. Version 0.15.2
$(document).ready(function()
{
var $select = $('#client').selectize({
create: false,
sortField: 'text',
preload: true,
openOnFocus: true,
valueField: 'id',
labelField: 'text',
allowEmptyOption: true,
showEmptyOptionInDropdow: true,
onChange: function(id) {
// this runs twice in Firefox
console.log('Selectize value changed to: ' + id);
$select[0].selectize.setValue('', true); // select another option
},
});
var selectize = $select[0].selectize;
});
Metadata
Metadata
Assignees
Labels
No labels