LeaVerou / awesomplete

Ultra lightweight, usable, beautiful autocomplete with zero dependencies.
http://leaverou.github.io/awesomplete/
MIT License
6.96k stars 611 forks source link

Distinguish between click and enter selections #17179

Closed briandipalma closed 5 years ago

briandipalma commented 5 years ago

The event "awesomplete-selectcomplete" provides you with the selected option but it doesn't tell you the user action that triggered the selection. Could I create a PR that provided the underlying event?

Basically keydown would pass the evt value to select

me.select(undefined, undefined, evt); and select would pass that on

"awesomplete-selectcomplete", {
  evt: evt,
  text: suggestion
}

and similar for click. Would that be an acceptable change?

LeaVerou commented 5 years ago

I would call it originalEvent, but apart from that, sure (as long as the PR also documents it)!

briandipalma commented 5 years ago

Hi, is it possible to get this change released to npm?