2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-25 14:17:45 +00:00

Rev for 1.4.4 release

This commit is contained in:
Tomas Kirda 2017-10-30 16:17:09 -05:00
parent a7e84a4799
commit 70de1a5e3e
5 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "devbridge-autocomplete", "name": "devbridge-autocomplete",
"version": "1.4.3", "version": "1.4.4",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete", "homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"authors": [ "authors": [
"Tomas Kirda" "Tomas Kirda"

View File

@ -6,7 +6,7 @@
"ajax", "ajax",
"autocomplete" "autocomplete"
], ],
"version": "1.4.3", "version": "1.4.4",
"author": { "author": {
"name": "Tomas Kirda", "name": "Tomas Kirda",
"url": "https://github.com/tkirda" "url": "https://github.com/tkirda"

View File

@ -1,5 +1,5 @@
/** /**
* Ajax Autocomplete for jQuery, version 1.4.3 * Ajax Autocomplete for jQuery, version 1.4.4
* (c) 2017 Tomas Kirda * (c) 2017 Tomas Kirda
* *
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license. * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@ -192,7 +192,6 @@
container.children('.' + selected).removeClass(selected); container.children('.' + selected).removeClass(selected);
}); });
// Listen for click event on suggestions list: // Listen for click event on suggestions list:
container.on('click.autocomplete', suggestionSelector, function () { container.on('click.autocomplete', suggestionSelector, function () {
that.select($(this).data('index')); that.select($(this).data('index'));
@ -457,6 +456,11 @@
}, },
onValueChange: function () { onValueChange: function () {
if (this.ignoreValueChange) {
this.ignoreValueChange = false;
return;
}
var that = this, var that = this,
options = that.options, options = that.options,
value = that.el.val(), value = that.el.val(),
@ -856,6 +860,7 @@
if (that.selectedIndex === 0) { if (that.selectedIndex === 0) {
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected); $(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
that.selectedIndex = -1; that.selectedIndex = -1;
that.ignoreValueChange = false;
that.el.val(that.currentValue); that.el.val(that.currentValue);
that.findBestHint(); that.findBestHint();
return; return;
@ -898,8 +903,14 @@
} }
if (!that.options.preserveInput) { if (!that.options.preserveInput) {
// During onBlur event, browser will trigger "change" event,
// because value has changed, to avoid side effect ignore,
// that event, so that correct suggestion can be selected
// when clicking on suggestion with a mouse
that.ignoreValueChange = true;
that.el.val(that.getValue(that.suggestions[index].value)); that.el.val(that.getValue(that.suggestions[index].value));
} }
that.signalHint(null); that.signalHint(null);
}, },

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "devbridge-autocomplete", "name": "devbridge-autocomplete",
"version": "1.4.3", "version": "1.4.4",
"description": "Autocomplete provides suggestions while you type into the text field.", "description": "Autocomplete provides suggestions while you type into the text field.",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete", "homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"author": "Tomas Kirda (https://twitter.com/tkirda)", "author": "Tomas Kirda (https://twitter.com/tkirda)",