Skip to content

Commit

Permalink
fix(js): support onStateChange
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Oct 5, 2020
1 parent 648f1e8 commit e4c1488
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion packages/autocomplete-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ function getSuggestionFromHighlightedIndex<TItem>({
* [['a', 'b'], ['c', 'd', 'e'], ['f']]
* ↑
* (absolute: 3, relative: 1)
* @param param0
*/
function getRelativeHighlightedIndex<TItem>({
state,
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-js/src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function autocomplete<TItem>({
const dropdown = document.createElement('div');

const autocomplete = createAutocomplete<TItem>({
...props,
onStateChange(options) {
const { state } = options;
render(state as any);
Expand All @@ -48,7 +49,6 @@ export function autocomplete<TItem>({
props.onStateChange(options);
}
},
...props,
});

const onResize = debounce(() => {
Expand Down

0 comments on commit e4c1488

Please sign in to comment.