Skip to content

Commit 408fc4c

Browse files
committed
fix(a11y): update previous and next (disabled) buttons for vo a11y
1 parent d294526 commit 408fc4c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/layouts/Posts.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ const next = pageNum < totalPages ? "" : "disabled";
3838

3939
<nav class="pagination-wrapper" aria-label="Pagination Navigation">
4040
<LinkButton
41-
tabindex={prev === "disabled" ? "-1" : "0"}
41+
disabled={prev === "disabled"}
4242
href={`/posts${pageNum - 1 !== 1 ? "/" + (pageNum - 1) : ""}`}
4343
className={`mr-4 select-none ${prev}`}
44+
ariaLabel="Previous"
4445
>
4546
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
4647
<path
@@ -50,9 +51,10 @@ const next = pageNum < totalPages ? "" : "disabled";
5051
Prev
5152
</LinkButton>
5253
<LinkButton
53-
tabindex={next === "disabled" ? "-1" : "0"}
54+
disabled={next === "disabled"}
5455
href={`/posts/${pageNum + 1}`}
5556
className={`ml-4 select-none ${next}`}
57+
ariaLabel="Next"
5658
>
5759
Next
5860
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>

0 commit comments

Comments
 (0)