Pass item as a parameter to onChangeListener

Vitaliy Filippov 9 years ago
parent 2c39146394
commit f140faedb9
  1. 4
  2. 2

@ -42,7 +42,7 @@
If you don't want to touch the input value, but want to use multi-select for
your own purposes, specify a callback that will handle item clicks here.
Also you can disable and check/uncheck items during loading in this mode.
onChangeListener(hint, index)
onChangeListener(hint, index, item)
Callback which is called when input value is changed using this dropdown.
index is the number of element which selection is changed, starting with 0.
It must be used instead of normal 'onchange' event.
@ -332,7 +332,7 @@ SimpleAutocomplete.prototype.selectItem = function(index)
this.curValue = this.input.value;
if (this.onChangeListener)
this.onChangeListener(this, index);
this.onChangeListener(this, index, this.items[index]);
// Change input value so it will respect index'th item state in a multi-select

hinter.min.js vendored

File diff suppressed because one or more lines are too long