Skip to content

Commit

Permalink
Merge pull request #185 from mabentley85/pagination-event-forwarding
Browse files Browse the repository at this point in the history
Added Event Forwarding To Pagination Component
  • Loading branch information
metonym authored May 30, 2020
2 parents 97873e5 + eaeb303 commit 5e20571
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Pagination/Pagination.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
import CaretRight24 from 'carbon-icons-svelte/lib/CaretRight24';
import { cx, fillArray } from '../../lib';
import Select, { SelectItem } from '../Select';
import { afterUpdate, createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
afterUpdate(() => {
dispatch('update', {pageSize: parseInt(pageSize), page: parseInt(page)});
});
$: totalPages = Math.max(Math.ceil(totalItems / pageSize), 1);
$: selectItems = fillArray(totalPages);
Expand Down

0 comments on commit 5e20571

Please sign in to comment.