From 82065b51c3fe29496745b91bf2c94a457ef273ff Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 18 Sep 2018 15:16:51 +0200 Subject: [PATCH] Fix unwanted autocomplete showing up for country-select widget --- addressbook/templates/default/app.css | 3 ++- addressbook/templates/pixelegg/app.css | 3 +++ api/js/etemplate/et2_widget_selectbox.js | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addressbook/templates/default/app.css b/addressbook/templates/default/app.css index fdb9338aee..87ee32eb73 100644 --- a/addressbook/templates/default/app.css +++ b/addressbook/templates/default/app.css @@ -118,4 +118,5 @@ select#addressbook-index_col_filter\[tid\] { #addressbook-index_addressbook-index-row select{ float: right; width: 134px; -} \ No newline at end of file +} +#addressbook-edit .chzn-container .chzn-results {max-height: 110px} \ No newline at end of file diff --git a/addressbook/templates/pixelegg/app.css b/addressbook/templates/pixelegg/app.css index b473eb7493..dfa0cd3a25 100755 --- a/addressbook/templates/pixelegg/app.css +++ b/addressbook/templates/pixelegg/app.css @@ -140,6 +140,9 @@ select#addressbook-index_col_filter\[tid\] { float: right; width: 134px; } +#addressbook-edit .chzn-container .chzn-results { + max-height: 110px; +} @media all { /* ############################################################################# diff --git a/api/js/etemplate/et2_widget_selectbox.js b/api/js/etemplate/et2_widget_selectbox.js index 8e48de4f19..d34db09050 100644 --- a/api/js/etemplate/et2_widget_selectbox.js +++ b/api/js/etemplate/et2_widget_selectbox.js @@ -749,9 +749,11 @@ var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend( allow_single_deselect: this.options.allow_single_deselect, no_results_text: this.egw().lang('No results match') }); - if (this._type == 'select-country' && this.getValue()) { + // set autocomplete for search input field to an arbitary value in order to stop it. + this.input.siblings().find('.chzn-search input').attr('autocomplete', 'new-password'); + if (this._type == 'select-country') { var selected = this.input.siblings().find('a.chzn-single'); - if (selected && selected.length == 1) + if (selected && selected.length == 1 && this.getValue()) { selected.removeClass (function (index, className) { return (className.match (/(^|\s)flag-\S+/g) || []).join(' ');