Skip to content

Commit

Permalink
fix(js): call debounced function
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Sep 8, 2020
1 parent eb53dca commit 0662e1b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/autocomplete-js/src/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ export function autocomplete<TItem>({
...props,
});

function onResize() {
return debounce(() => {
if (!dropdown.hasAttribute('hidden')) {
setDropdownPosition();
}
}, 100);
}
const onResize = debounce(() => {
if (!dropdown.hasAttribute('hidden')) {
setDropdownPosition();
}
}, 100);

function setDropdownPosition() {
setProperties(dropdown, {
Expand Down

0 comments on commit 0662e1b

Please sign in to comment.