From 5e9dd80c471e09f66fc940a14641a37060a1f212 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 18 May 2018 11:42:51 +0000 Subject: [PATCH] Elastic: Fix corner-case for closing pretty select options list --- skins/elastic/ui.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index cec43cd58..41788c37d 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -2975,8 +2975,11 @@ function rcube_elastic_ui() .append(items) .data('button', select[0]) // needed for dropdown closing code .on('click', 'a.active', function() { - select.val($(this).data('value')).change(); - return close_func(); + // first close the list, then update the select, the order is important + //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) { var item, node, mode = 'next';