Set tabindex to -1 when prev/next link is disabled

This commit is contained in:
Sat Naing
2022-09-21 09:23:03 +06:30
parent d11f23323c
commit 3cff5cabb1
+2
View File
@@ -36,6 +36,7 @@ const next = pageNum < totalPages ? "" : "disabled";
<nav class="pagination-wrapper" aria-label="Pagination Navigation"> <nav class="pagination-wrapper" aria-label="Pagination Navigation">
<LinkButton <LinkButton
tabindex={prev === "disabled" ? "-1" : "0"}
href={`/posts/${pageNum - 1}`} href={`/posts/${pageNum - 1}`}
className={`mr-4 select-none ${prev}`} className={`mr-4 select-none ${prev}`}
> >
@@ -47,6 +48,7 @@ const next = pageNum < totalPages ? "" : "disabled";
Prev Prev
</LinkButton> </LinkButton>
<LinkButton <LinkButton
tabindex={next === "disabled" ? "-1" : "0"}
href={`/posts/${pageNum + 1}`} href={`/posts/${pageNum + 1}`}
className={`ml-4 select-none ${next}`} className={`ml-4 select-none ${next}`}
> >