treshold -> threshold
This commit is contained in:
parent
144aaa270e
commit
bb0df53678
@ -87,7 +87,7 @@ If set to true, will display the value of the entry after the label in the dropd
|
|||||||
**showValueBeforeLabel**:
|
**showValueBeforeLabel**:
|
||||||
If set to true and `showValue` also set to true, the value will be displayed before the label.
|
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.
|
The number of characters that need to be typed on the input in order to trigger the autocomplete. Default is 4.
|
||||||
|
|
||||||
**value**:
|
**value**:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const DEFAULTS = {
|
const DEFAULTS = {
|
||||||
treshold: 2,
|
threshold: 2,
|
||||||
maximumItems: 5,
|
maximumItems: 5,
|
||||||
highlightTyped: true,
|
highlightTyped: true,
|
||||||
highlightClass: 'text-primary',
|
highlightClass: 'text-primary',
|
||||||
@ -90,7 +90,7 @@ class Autocomplete {
|
|||||||
|
|
||||||
createItems() {
|
createItems() {
|
||||||
const lookup = this.field.value;
|
const lookup = this.field.value;
|
||||||
if (lookup.length < this.options.treshold) {
|
if (lookup.length < this.options.threshold) {
|
||||||
this.dropdown.hide();
|
this.dropdown.hide();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
const ac = new Autocomplete(field, {
|
const ac = new Autocomplete(field, {
|
||||||
data: [{label: "I'm a label", value: 42}],
|
data: [{label: "I'm a label", value: 42}],
|
||||||
maximumItems: 5,
|
maximumItems: 5,
|
||||||
treshold: 1,
|
threshold: 1,
|
||||||
onSelectItem: ({label, value}) => {
|
onSelectItem: ({label, value}) => {
|
||||||
console.log("user selected:", label, value);
|
console.log("user selected:", label, value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user