From 35f2f3fcf1074852c73e225c1652e9e5e799d474 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 11 Sep 2017 11:57:55 +0200 Subject: [PATCH] Fix allowFreeEntry taglist does not get rendered after focus out from input field --- api/js/etemplate/et2_widget_taglist.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_taglist.js b/api/js/etemplate/et2_widget_taglist.js index 82c4ebf424..3c7cbc64bc 100644 --- a/api/js/etemplate/et2_widget_taglist.js +++ b/api/js/etemplate/et2_widget_taglist.js @@ -236,7 +236,7 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR renderer: jQuery.proxy(this.options.listRenderer || this.selectionRenderer,this), maxSelection: this.options.multiple ? this.options.maxSelection : 1, maxSelectionRenderer: jQuery.proxy(function(v) { this.egw().lang('You can not choose more then %1 item(s)!', v); }, this), - minCharsRenderer: jQuery.proxy(function(v){ + minCharsRenderer: jQuery.proxy(function(v){ this.egw().lang(v == 1 ? 'Please type 1 more character' : 'Please type %1 more characters',v); }, this), width: this.options.width, // propagate width @@ -356,8 +356,13 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR if(document.activeElement === document.body || widget.div.has(document.activeElement).length > 0) { + if (widget.options.allowFreeEntries) taglist.container.blur(); taglist.input.focus(); } + else if (widget.options.allowFreeEntries) + { + taglist.container.blur(); + } });},100 ); this.$taglist.one('collapse', function() { @@ -408,7 +413,7 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR // multiple on the page this.div.on('blur', 'input', function() { jQuery('.ms-ctn-focus', widget.div).removeClass('ms-ctn-focus'); - }) + }); return true; },