mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
fix(a11y): update previous and next (disabled) buttons for vo a11y
This commit is contained in:
@@ -38,9 +38,10 @@ 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"}
|
disabled={prev === "disabled"}
|
||||||
href={`/posts${pageNum - 1 !== 1 ? "/" + (pageNum - 1) : ""}`}
|
href={`/posts${pageNum - 1 !== 1 ? "/" + (pageNum - 1) : ""}`}
|
||||||
className={`mr-4 select-none ${prev}`}
|
className={`mr-4 select-none ${prev}`}
|
||||||
|
ariaLabel="Previous"
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
|
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
|
||||||
<path
|
<path
|
||||||
@@ -50,9 +51,10 @@ const next = pageNum < totalPages ? "" : "disabled";
|
|||||||
Prev
|
Prev
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
<LinkButton
|
<LinkButton
|
||||||
tabindex={next === "disabled" ? "-1" : "0"}
|
disabled={next === "disabled"}
|
||||||
href={`/posts/${pageNum + 1}`}
|
href={`/posts/${pageNum + 1}`}
|
||||||
className={`ml-4 select-none ${next}`}
|
className={`ml-4 select-none ${next}`}
|
||||||
|
ariaLabel="Next"
|
||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>
|
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user