From 5723f77ef720daf7ae1d5d697472ddf52c7f9f8c Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sat, 8 Dec 2018 20:51:06 +0100 Subject: Fixes the share autocomplete scrollbars Signed-off-by: Michael Weimann --- core/js/sharedialogview.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index e2ef8db90eb..a433570b13d 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -772,7 +772,16 @@ event.preventDefault(); }, source: this.autocompleteHandler, - select: this._onSelectRecipient + select: this._onSelectRecipient, + open: function() { + var autocomplete = $(this).autocomplete('widget'); + var numberOfItems = autocomplete.find('li').size(); + autocomplete.removeClass('item-count-1'); + autocomplete.removeClass('item-count-2'); + if (numberOfItems <= 2) { + autocomplete.addClass('item-count-' + numberOfItems); + } + } }).data('ui-autocomplete')._renderItem = this.autocompleteRenderItem; $shareField.on('keydown', null, shareFieldKeydownHandler); -- cgit v1.2.3