diff --git a/dev/External/User/ko.js b/dev/External/User/ko.js index 9a173d44f..2aa9cba3b 100644 --- a/dev/External/User/ko.js +++ b/dev/External/User/ko.js @@ -77,12 +77,9 @@ ko.bindingHandlers.emailsTags = { : null; }, parseHook: input => - input.map(inputValue => { - const values = EmailModel.parseEmailLine(inputValue); - return values.length ? values : inputValue; - }).flat(Infinity).map( - item => (item.toLine ? [item.toLine(false), item] : [item, null]) - ), + input.map(inputValue => EmailModel.parseEmailLine(inputValue)) + .flat(Infinity) + .map(item => (item.toLine ? [item.toLine(false), item] : [item, null])), onChange: value => { element.EmailsTagsValue = value; fValue(value); diff --git a/vendors/inputosaurus/inputosaurus.js b/vendors/inputosaurus/inputosaurus.js index dd607001b..d50851a01 100644 --- a/vendors/inputosaurus/inputosaurus.js +++ b/vendors/inputosaurus/inputosaurus.js @@ -80,7 +80,7 @@ this.Inputosaurus = class { self.input.addEventListener('focus', () => self._focusTrigger(true)); self.input.addEventListener('blur', () => { // prevent autoComplete menu click from causing a false 'blur' - self._parseInput(); + self._parseInput(true); self._focusTrigger(false); }); self.input.addEventListener('keydown', e => { @@ -97,7 +97,7 @@ this.Inputosaurus = class { self._updateDatalist(); } else if (e.key == 'Enter') { e.preventDefault(); - self._parseInput(); + self._parseInput(true); } }); self.input.addEventListener('input', () => { @@ -148,8 +148,11 @@ this.Inputosaurus = class { datalist.textContent = ''; } - _parseInput() { - this._parseValue(this.input.value) && (this.input.value = ''); + _parseInput(force) { + let val = this.input.value; + if (force || val.includes(',') || val.includes(';')) { + this._parseValue(val) && (this.input.value = ''); + } this._resizeInput(); }