Skip to content

Commit

Permalink
Make edit site pagination buttons accessibly disabled. (WordPress#62267)
Browse files Browse the repository at this point in the history
Co-authored-by: afercia <afercia@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
  • Loading branch information
3 people authored and patil-vipul committed Jun 17, 2024
1 parent 554712e commit eaee266
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@
margin-bottom: $grid-unit-05;
line-height: 1.2;
}
.components-button.is-tertiary:disabled {
.components-button.is-tertiary:disabled,
.components-button.is-tertiary[aria-disabled="true"] {
color: $gray-600;
}
.components-button.is-tertiary:hover {
Expand Down
12 changes: 4 additions & 8 deletions packages/edit-site/src/components/pagination/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ export default function Pagination( {
<Button
variant={ buttonVariant }
onClick={ () => changePage( 1 ) }
// Disable reason: Would not cause confusion, and allows quicker access to a relevant nav button.
// eslint-disable-next-line no-restricted-syntax
__experimentalIsFocusable
disabled={ disabled || currentPage === 1 }
aria-label={ __( 'First page' ) }
>
Expand All @@ -56,8 +55,7 @@ export default function Pagination( {
<Button
variant={ buttonVariant }
onClick={ () => changePage( currentPage - 1 ) }
// Disable reason: Would not cause confusion, and allows quicker access to a relevant nav button.
// eslint-disable-next-line no-restricted-syntax
__experimentalIsFocusable
disabled={ disabled || currentPage === 1 }
aria-label={ __( 'Previous page' ) }
>
Expand All @@ -76,8 +74,7 @@ export default function Pagination( {
<Button
variant={ buttonVariant }
onClick={ () => changePage( currentPage + 1 ) }
// Disable reason: Would not cause confusion, and allows quicker access to a relevant nav button.
// eslint-disable-next-line no-restricted-syntax
__experimentalIsFocusable
disabled={ disabled || currentPage === numPages }
aria-label={ __( 'Next page' ) }
>
Expand All @@ -86,8 +83,7 @@ export default function Pagination( {
<Button
variant={ buttonVariant }
onClick={ () => changePage( numPages ) }
// Disable reason: Would not cause confusion, and allows quicker access to a relevant nav button.
// eslint-disable-next-line no-restricted-syntax
__experimentalIsFocusable
disabled={ disabled || currentPage === numPages }
aria-label={ __( 'Last page' ) }
>
Expand Down

0 comments on commit eaee266

Please sign in to comment.