diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-01-05 17:56:50 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-01-05 17:56:50 +0300 |
commit | bb0df53678c5b61c6adcf9c7939920f4ff5c11f3 (patch) | |
tree | e8a67d71bfcba66598e6660fd77ef755f54cb5e5 | |
parent | 144aaa270ea7f443d80e3e1016690fa0c7b1e9f2 (diff) |
treshold -> threshold
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | autocomplete.js | 4 | ||||
-rw-r--r-- | example/example.html | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -87,7 +87,7 @@ If set to true, will display the value of the entry after the label in the dropd **showValueBeforeLabel**: If set to true and `showValue` also set to true, the value will be displayed before the label. -**treshold**: +**threshold**: The number of characters that need to be typed on the input in order to trigger the autocomplete. Default is 4. **value**: diff --git a/autocomplete.js b/autocomplete.js index a8de5fe..aa2ad12 100644 --- a/autocomplete.js +++ b/autocomplete.js @@ -1,5 +1,5 @@ const DEFAULTS = { - treshold: 2, + threshold: 2, maximumItems: 5, highlightTyped: true, highlightClass: 'text-primary', @@ -90,7 +90,7 @@ class Autocomplete { createItems() { const lookup = this.field.value; - if (lookup.length < this.options.treshold) { + if (lookup.length < this.options.threshold) { this.dropdown.hide(); return 0; } diff --git a/example/example.html b/example/example.html index 225105d..1127b49 100644 --- a/example/example.html +++ b/example/example.html @@ -23,7 +23,7 @@ const ac = new Autocomplete(field, { data: [{label: "I'm a label", value: 42}], maximumItems: 5, - treshold: 1, + threshold: 1, onSelectItem: ({label, value}) => { console.log("user selected:", label, value); } |