Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
feat(js): pass state to render
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Aug 21, 2020
1 parent 8fb33b1 commit 7f7da3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/autocomplete-js/src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ type GetSources<TItem> = (
export interface AutocompleteOptions<TItem>
extends PublicAutocompleteCoreOptions<TItem> {
container: string | HTMLElement;
render(params: { root: HTMLElement; sections: HTMLElement[] }): void;
render(params: {
root: HTMLElement;
sections: HTMLElement[];
state: AutocompleteState<TItem>;
}): void;
getSources: GetSources<TItem>;
}

Expand Down Expand Up @@ -189,7 +193,7 @@ export function autocomplete<TItem>({
return section;
});

renderDropdown({ root: dropdown, sections });
renderDropdown({ root: dropdown, sections, state });
}

form.appendChild(label);
Expand Down

0 comments on commit 7f7da3d

Please sign in to comment.