Skip to content

Commit b07827d

Browse files
attempt of fixing #684
Calling of `options.onInvalidateSelection` in onBlur timer.
1 parent c8f6072 commit b07827d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,19 @@
227227
},
228228

229229
onBlur: function () {
230-
var that = this;
230+
var that = this,
231+
options = that.options,
232+
value = that.el.val(),
233+
query = that.getQuery(value);
231234

232235
// If user clicked on a suggestion, hide() will
233236
// be canceled, otherwise close suggestions
234237
that.blurTimeoutId = setTimeout(function () {
235238
that.hide();
239+
240+
if (that.selection && that.currentValue !== query) {
241+
(options.onInvalidateSelection || $.noop).call(that.element);
242+
}
236243
}, 200);
237244
},
238245

0 commit comments

Comments
 (0)