From 65e37e602e02b0059fdcbdbd2acfc6510b35f374 Mon Sep 17 00:00:00 2001 From: Benjamin Hinchley Date: Tue, 5 Nov 2019 17:37:56 +1100 Subject: [PATCH] components/Paginator: prevent event propogation of paginator buttons --- src/components/Paginator/Paginator.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/Paginator/Paginator.tsx b/src/components/Paginator/Paginator.tsx index 7e769270d..d67923f87 100644 --- a/src/components/Paginator/Paginator.tsx +++ b/src/components/Paginator/Paginator.tsx @@ -44,7 +44,10 @@ export function Paginator(props: PaginatorProps) { {page !== 1 && ( { + event.stopPropagation(); + prevPage(paginate, page); + }} styles={styles.controls} /> )} @@ -62,7 +65,10 @@ export function Paginator(props: PaginatorProps) { { + event.stopPropagation(); + setPage(paginate, pageNumber); + }} styles={styles.number} /> @@ -72,7 +78,10 @@ export function Paginator(props: PaginatorProps) { {page !== totalPages && ( { + event.stopPropagation(); + nextPage(paginate, page, totalPages); + }} styles={styles.controls} /> )} @@ -106,6 +115,7 @@ function PreviousPageButton(props: PageButtonProps) { function NextPageButton(props: PageButtonProps) { return (