Skip to content

Commit

Permalink
Remove pagebutton variable from higher scope
Browse files Browse the repository at this point in the history
  • Loading branch information
pavish committed Mar 22, 2022
1 parent a3e777c commit cd6dcce
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
$: pageCount = Math.ceil(total / pageSize);
$: pageInfo = calculatePages(currentPage, pageCount);
let pagebutton: HTMLElement | null = null;
async function setPage(e: Event, _page: number) {
if (_page > 0 && _page <= pageCount && currentPage !== _page) {
Expand All @@ -56,8 +55,8 @@
});
}
await tick();
pagebutton = document.querySelector(`[data-page="${currentPage}"]`);
pagebutton?.focus();
const pagebutton = document.querySelector(`[data-page="${currentPage}"]`);
(pagebutton as HTMLElement)?.focus();
}
</script>

Expand Down

0 comments on commit cd6dcce

Please sign in to comment.