Skip to content

Commit

Permalink
label is optional now, because it is not required for custom rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-taran committed Aug 7, 2018
1 parent 0db30cb commit 7467c62
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion autocomplete.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface AutocompleteItem {
label: string;
label?: string;
group?: string;
}
export interface AutocompleteSettings<T extends AutocompleteItem> {
Expand Down
2 changes: 1 addition & 1 deletion autocomplete.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

export interface AutocompleteItem {
label: string;
label?: string;
group?: string;
}

Expand Down Expand Up @@ -104,7 +104,7 @@ export function autocomplete<T extends AutocompleteItem>(settings: AutocompleteS
// function for rendering autocomplete suggestions
let render = function(item: T, currentValue: string): HTMLDivElement | undefined {
const itemElement = doc.createElement("div");
itemElement.textContent = item.label;
itemElement.textContent = item.label || "";
return itemElement;
};
if (settings.render) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autocompleter",
"version": "2.0.0",
"version": "2.0.1",
"description": "Blazing fast and lightweight autocomplete library without dependencies. 1KB gzipped.",
"main": "autocomplete.js",
"scripts": {
Expand Down

0 comments on commit 7467c62

Please sign in to comment.