From 7a674ff8aa22a3d7ebfda911b240df5c20499c8a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 22 Apr 2014 15:47:22 +0000 Subject: [PATCH] Don't add empty label as option for tags or search (chosen), it's registered as a real option. --- etemplate/js/et2_widget_selectbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_selectbox.js b/etemplate/js/et2_widget_selectbox.js index c5545e7fd7..b5fab60669 100644 --- a/etemplate/js/et2_widget_selectbox.js +++ b/etemplate/js/et2_widget_selectbox.js @@ -678,6 +678,9 @@ var et2_selectbox = et2_inputWidget.extend( this.input.children('[value=""]').remove(); } } + // Don't do it again if already done + if(this.input.hasClass("chzn-done")) return; + // Properly size chosen, even if on a hidden tab var size = egw.getHiddenDimensions(this.input); this.input.chosen({ @@ -706,7 +709,8 @@ var et2_selectbox = et2_inputWidget.extend( this.multiOptions.empty(); } // Re-add empty, it's usually not there (empty_label get's allways translated, independent of no_lang!) - if(this.options.empty_label) + // Empty label should not be added as an option for chosen, it conflicts + if(this.options.empty_label && !(this.options.tags || this.options.search)) { this._appendOptionElement('', this.egw().lang(this.options.empty_label)); }