SyedWasiHaider / vue-highlightable-input

A vue component to highlight text as you're typing
MIT License
183 stars 30 forks source link

Add input method editors support #28

Open oulan opened 2 years ago

oulan commented 2 years ago

// 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)

//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)