From c17bebaab00c8c8c6af557b7bde64f435acc3559 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 25 Feb 2016 18:34:20 +0000 Subject: [PATCH] Instead of showing invalid email values, remove them and set a validation error then focus the value so user can keep editing. --- etemplate/js/et2_widget_taglist.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_taglist.js b/etemplate/js/et2_widget_taglist.js index 5cb694ab04..3fb3774475 100644 --- a/etemplate/js/et2_widget_taglist.js +++ b/etemplate/js/et2_widget_taglist.js @@ -760,7 +760,15 @@ var et2_taglist_email = et2_taglist.extend( if (item.class) label.addClass(item.class); if (typeof item.title != 'undefined') label.attr('title', item.title); if (typeof item.data != 'undefined') label.attr('data', item.data); - if (!valid) label.addClass('ui-state-error'); + if (!valid) { + label.addClass('ui-state-error'); + window.setTimeout(jQuery.proxy(function() { + this.taglist.removeFromSelection(item); + this.set_validation_error(egw.lang("'%1' has an invalid format",item.label)); + this.taglist.input.val(item.label).focus(); + },this),1); + return null; + } return label; }