vue-highlightable-input icon indicating copy to clipboard operation
vue-highlightable-input copied to clipboard

Add input method editors support

Open oulan opened this issue 3 years ago • 0 comments

// add new event handlers mounted () { if (this.fireOnEnabled) this.$el.addEventListener(this.fireOn, this.handleChange)

  +this.$el.addEventListener("compositionstart", this.IMEStart)
  +this.$el.addEventListener("compositionend", this.IMEEnd)
  +this.$el.addEventListener("compositionudpate", this.IMEUpdate)

  this.internalValue = this.value
  this.processHighlights()

},

// value changed value() { +if(this.composing) + return if (this.internalValue != this.value){ this.internalValue = this.value this.processHighlights() } },

//new event handlers for composition events IMEStart(event) { this.composing = true; },

IMEEnd(event) {
  this.composing = false;
},

IMEUdpate(event) {
  this.composing = true;
},

// Change handle event handleChange() { this.debouncedHandler = debounce(function(){ +if(this.composing) + return if (this.internalValue !== this.$el.textContent){ this.internalValue = this.$el.textContent this.processHighlights(); } }, this.highlightDelay) this.debouncedHandler(); },

oulan avatar Dec 21 '21 04:12 oulan