20 Commits

Author SHA1 Message Date
Evgeny Zinoviev
5ce977959b fix for accented characters (#8) 2022-01-05 18:48:19 +03:00
Evgeny Zinoviev
bb0df53678 treshold -> threshold 2022-01-05 17:56:50 +03:00
Evgeny Zinoviev
144aaa270e readme fixes 2021-09-21 23:28:01 +03:00
Evgeny Zinoviev
a554125f3e added showValueBeforeLabel option 2021-09-21 23:23:55 +03:00
Evgeny Zinoviev
603ddb9323
Merge pull request #6 from sp00n/master
Added the ability to set the label and value key names
2021-05-21 02:29:43 +03:00
sp00n
4c10d574c4
Update README.md 2021-05-21 00:01:09 +02:00
sp00n
ce7994b85d
Forgot one showValue 2021-05-20 23:59:55 +02:00
sp00n
5b499555fa
Renamed to displayLabelWithValue to showValue 2021-05-20 23:59:12 +02:00
sp00n
024880c524
Added a displayLabelWithValue option
Setting displayLabelWithValue to true will display the value after the label in the dropdown.
Also added a couple of missing semicolons.
2021-05-20 23:53:28 +02:00
sp00n
32bcb0326a
Update README.md 2021-05-20 22:55:02 +02:00
sp00n
fb30170bc1
Added the ability to set the label and value key names
You can now set the names of the `label` and `value` keys in the options. They default to `label` and `value` to not break the current behavior, but you can also set them to `null`, so that you can use a simple object instead of an array of objects, just like in bootstrap-4-autocomplete.

Examples:
```
const ac = new Autocomplete(field, {
    data: [{name: "entry1", text: "The first entry"}, {name: "entry2", text: "The second entry"}],
    label: "name",
    value: "text",
    onSelectItem: ({label, value}) => {
        console.log("user selected:", label, value);
    }
});



const ac = new Autocomplete(field, {
    data: {entry1: "The first entry", entry2: "The second entry"},
    label: null,
    value: null,
    onSelectItem: ({label, value}) => {
        console.log("user selected:", label, value);
    }
});
```
2021-05-20 22:41:03 +02:00
Evgeny Zinoviev
dbca6d0a99
Merge pull request #4 from lukasjelonek/master
Fix bug: Navigation with cursor keys does not work
2021-05-19 13:30:15 +03:00
Lukas Jelonek
3f6e558144
Fix bug: Navigation with cursor keys does not work
data toggle field changed from `data-toggle` to `data-bs-toggle`
2021-05-19 09:07:43 +02:00
Evgeny S
147d3a70ea
Merge pull request #3 from CBke/arrowdownkey
set focus to first suggestion by down arrow key
2021-04-08 01:50:43 +03:00
Evgeny S
88f0973087
Merge pull request #2 from CBke/dynamicdata
render again if data has changed
2021-04-06 15:30:28 +03:00
Christophe
67c49775fd set focus to first suggestion by down arrow key 2021-03-31 18:34:30 +02:00
Christophe
82d0321f1f render again if data has changed 2021-03-31 18:30:13 +02:00
Evgeny Zinoviev
724ee6c6f4 add example 2021-02-01 17:31:59 +03:00
Evgeny Zinoviev
adf2068ba6 fix issue #1 2021-02-01 17:31:29 +03:00
Evgeny Zinoviev
80f28167ab initial commit 2021-01-03 23:46:02 +03:00