mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-09 14:50:57 +00:00
Merge pull request #751 from elektronika-ba/onInvalidateSelection_#684-_fix
Check selection during onBlur, fixes #684
This commit is contained in:
commit
e5df0659ea
@ -227,12 +227,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onBlur: function () {
|
onBlur: function () {
|
||||||
var that = this;
|
var that = this,
|
||||||
|
options = that.options,
|
||||||
|
value = that.el.val(),
|
||||||
|
query = that.getQuery(value);
|
||||||
|
|
||||||
// If user clicked on a suggestion, hide() will
|
// If user clicked on a suggestion, hide() will
|
||||||
// be canceled, otherwise close suggestions
|
// be canceled, otherwise close suggestions
|
||||||
that.blurTimeoutId = setTimeout(function () {
|
that.blurTimeoutId = setTimeout(function () {
|
||||||
that.hide();
|
that.hide();
|
||||||
|
|
||||||
|
if (that.selection && that.currentValue !== query) {
|
||||||
|
(options.onInvalidateSelection || $.noop).call(that.element);
|
||||||
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user