From 9faf50da42e64640d148df67ce2132119640e172 Mon Sep 17 00:00:00 2001 From: "Lukas.J.Han" Date: Thu, 15 Aug 2024 22:17:23 +0900 Subject: [PATCH] feat: add keyboard action Signed-off-by: Lukas.J.Han --- packages/core/lib/components/Pagination.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core/lib/components/Pagination.tsx b/packages/core/lib/components/Pagination.tsx index 9bb65ad..03bdaa9 100644 --- a/packages/core/lib/components/Pagination.tsx +++ b/packages/core/lib/components/Pagination.tsx @@ -184,6 +184,14 @@ export const Pagination: React.FC = ({ ); + const inputPageNumber = (e: React.KeyboardEvent) => { + if (e.key === ' ' || e.key === 'Enter') { + e.preventDefault(); + onPageChange(inputPage); + return; + } + }; + return (