diff --git a/src/parts/events.js b/src/parts/events.js index 7129d89d..556cf88f 100644 --- a/src/parts/events.js +++ b/src/parts/events.js @@ -506,7 +506,7 @@ export default { if( _s.mode == 'mix' ) return this.events.callbacks.onMixTagsInput.call(this, e); - var value = this.input.normalize.call(this), + var value = this.input.normalize.call(this, undefined, {trim: false}), showSuggestions = value.length >= _s.dropdown.enabled, eventData = {value, inputElm:this.DOM.input}, validation = this.validateTag({value}); @@ -517,6 +517,7 @@ export default { eventData.isValid = validation; + console.log(this.state.inputText , value) // for IE; since IE doesn't have an "input" event so "keyDown" is used instead to trigger the "onInput" callback, // and so many keys do not change the input, and for those do not continue. if( this.state.inputText == value ) return; diff --git a/src/tagify.js b/src/tagify.js index a7b753bb..1b7ad40f 100644 --- a/src/tagify.js +++ b/src/tagify.js @@ -713,7 +713,7 @@ Tagify.prototype = { }, // remove any child DOM elements that aren't of type TEXT (like
) - normalize( node ){ + normalize( node, options ){ var clone = node || this.DOM.input, //.cloneNode(true), v = []; @@ -730,7 +730,7 @@ Tagify.prototype = { v = v.replace(/\s/g, ' ') // replace NBSPs with spaces characters - return this.trim(v) + return options?.trim ? this.trim(v) : v }, /**