Skip to content

Commit d27a586

Browse files
author
Tomas Kirda
committed
Rev for 1.2.16 release
1 parent 54f2495 commit d27a586

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.15",
3+
"version": "1.2.16",
44
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
55
"authors": [
66
"Tomas Kirda"

devbridge-autocomplete.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ajax",
77
"autocomplete"
88
],
9-
"version": "1.2.15",
9+
"version": "1.2.16",
1010
"author": {
1111
"name": "Tomas Kirda",
1212
"url": "https://github.com/tkirda"

dist/jquery.autocomplete.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Ajax Autocomplete for jQuery, version 1.2.15
2+
* Ajax Autocomplete for jQuery, version 1.2.16
33
* (c) 2014 Tomas Kirda
44
*
55
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@@ -74,6 +74,7 @@
7474
onSearchStart: noop,
7575
onSearchComplete: noop,
7676
onSearchError: noop,
77+
preserveInput: false,
7778
containerClass: 'autocomplete-suggestions',
7879
tabDisabled: false,
7980
dataType: 'text',
@@ -196,6 +197,7 @@
196197
that.el.on('blur.autocomplete', function () { that.onBlur(); });
197198
that.el.on('focus.autocomplete', function () { that.onFocus(); });
198199
that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); });
200+
that.el.on('input.autocomplete', function (e) { that.onKeyUp(e); });
199201
},
200202

201203
onFocus: function () {
@@ -670,7 +672,7 @@
670672
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
671673
});
672674

673-
this.adjustContainerWidth();
675+
this.adjustContainerWidth();
674676

675677
noSuggestionsContainer.detach();
676678
container.html(html);
@@ -889,7 +891,9 @@
889891
$(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);
890892
}
891893

892-
that.el.val(that.getValue(that.suggestions[index].value));
894+
if (!that.options.preserveInput) {
895+
that.el.val(that.getValue(that.suggestions[index].value));
896+
}
893897
that.signalHint(null);
894898
},
895899

@@ -900,7 +904,7 @@
900904

901905
that.currentValue = that.getValue(suggestion.value);
902906

903-
if (that.currentValue !== that.el.val()) {
907+
if (that.currentValue !== that.el.val() && !that.options.preserveInput) {
904908
that.el.val(that.currentValue);
905909
}
906910

dist/jquery.autocomplete.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.15",
3+
"version": "1.2.16",
44
"description": "Autocomplete provides suggestions while you type into the text field.",
55
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
66
"author": "Tomas Kirda (https://twitter.com/tkirda)",

0 commit comments

Comments
 (0)