Skip to content

Commit 97e421c

Browse files
author
Tomas Kirda
committed
Merge pull request devbridge#62 from gedbac/master
Method 'clear' was added
2 parents 364fd6a + 19f0e6b commit 97e421c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The standard jquery.autocomplete.js file is around 2.7KB when minified via Closu
2929
Useful when for example you need to fill list of coma separated values.
3030
* `zIndex`: 'z-index' for suggestions container. Default: `9999`.
3131
* `type`: Ajax request type to get suggestions. Default: `GET`.
32-
* `noCache`: Boolean value indicating whether to cache suggestion results. Default `true`.
32+
* `noCache`: Boolean value indicating whether to cache suggestion results. Default `false`.
3333
* `onSearchStart`: `function (query) {}` called before ajax request. `this` is bound to input element.
3434
* `onSearchComplete`: `function (query) {}` called after ajax response is processed. `this` is bound to input element.
3535
* `tabDisabled`: Default `false`. Set to true to leave the cursor in the input field after the user tabs to select a suggestion.

src/jquery.autocomplete.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@
226226
this.badQueries = [];
227227
},
228228

229+
clear: function () {
230+
this.clearCache();
231+
this.currentValue = null;
232+
this.suggestions = [];
233+
},
234+
229235
disable: function () {
230236
this.disabled = true;
231237
},
@@ -632,4 +638,4 @@
632638
}
633639
});
634640
};
635-
}));
641+
}));

0 commit comments

Comments
 (0)