Elastic: Fix corner-case for closing pretty select options list

pull/5578/merge
Aleksander Machniak 7 years ago
parent 19d644879e
commit 5e9dd80c47

@ -2975,8 +2975,11 @@ function rcube_elastic_ui()
.append(items) .append(items)
.data('button', select[0]) // needed for dropdown closing code .data('button', select[0]) // needed for dropdown closing code
.on('click', 'a.active', function() { .on('click', 'a.active', function() {
select.val($(this).data('value')).change(); // first close the list, then update the select, the order is important
return close_func(); //for cases when the select might be removed in change event (datepicker)
var val = $(this).data('value'), ret = close_func();
select.val(val).change();
return ret;
}) })
.on('keydown', 'a.active', function(e) { .on('keydown', 'a.active', function(e) {
var item, node, mode = 'next'; var item, node, mode = 'next';

Loading…
Cancel
Save