yuku / textcomplete

Autocomplete for HTMLTextAreaElement and more.
https://yuku.takahashi.coffee/textcomplete/
MIT License
1.74k stars 303 forks source link

First time _onKeyUp not fired #279

Closed sudheerDev closed 4 years ago

sudheerDev commented 8 years ago

I am using this regex for triggering dropdown on '/'

      match: /\B\/([\-+\w]*)$/,

this match dosen't trigger dropdown the first time. If i change my match to any other character it does work fine though!

Upon some debugging i was able to check that

_bindEvents: function () {
  this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this));
},

_onKeyup: function (e) {
  if (this._skipSearch(e)) { return; }
  this.completer.trigger(this.getTextFromHeadToCaret(), true);
},

the _onKeyup is not getting called the first time around any idea why?