Skip to content

Commit

Permalink
fix(a11y): update previous and next (disabled) buttons for vo a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
satnaing committed Nov 26, 2022
1 parent d294526 commit 408fc4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/layouts/Posts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const next = pageNum < totalPages ? "" : "disabled";

<nav class="pagination-wrapper" aria-label="Pagination Navigation">
<LinkButton
tabindex={prev === "disabled" ? "-1" : "0"}
disabled={prev === "disabled"}
href={`/posts${pageNum - 1 !== 1 ? "/" + (pageNum - 1) : ""}`}
className={`mr-4 select-none ${prev}`}
ariaLabel="Previous"
>
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
<path
Expand All @@ -50,9 +51,10 @@ const next = pageNum < totalPages ? "" : "disabled";
Prev
</LinkButton>
<LinkButton
tabindex={next === "disabled" ? "-1" : "0"}
disabled={next === "disabled"}
href={`/posts/${pageNum + 1}`}
className={`ml-4 select-none ${next}`}
ariaLabel="Next"
>
Next
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>
Expand Down

0 comments on commit 408fc4c

Please sign in to comment.