Skip to content

Commit

Permalink
Revert "Pagination: Accessibility enhancements (#5488)"
Browse files Browse the repository at this point in the history
This reverts commit e352e19.
  • Loading branch information
francinelucca committed Jan 9, 2025
1 parent 4aa4fd4 commit b919972
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
5 changes: 0 additions & 5 deletions .changeset/eighty-carpets-rush.md

This file was deleted.

20 changes: 4 additions & 16 deletions packages/react/src/Pagination/Pagination.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useState} from 'react'
import React from 'react'
import type {Meta, StoryFn} from '@storybook/react'
import type {ComponentProps} from '../utils/types'
import Pagination from './Pagination'
Expand Down Expand Up @@ -26,21 +26,9 @@ const parseShowPagesArg = (value: boolean | string) => {
}
}

export const Default = () => {
const [page, setPage] = useState(2)

return (
<Pagination
pageCount={15}
currentPage={page}
onPageChange={(e, n) => {
e.preventDefault()
setPage(n)
}}
showPages={{narrow: false}}
/>
)
}
export const Default = () => (
<Pagination pageCount={15} currentPage={2} onPageChange={e => e.preventDefault()} showPages={{narrow: false}} />
)

export const Playground: StoryFn<ComponentProps<typeof Pagination>> = ({showPages, ...args}) => {
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Pagination/model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function buildComponentData(
key = 'page-prev'
content = 'Previous'
if (page.disabled) {
Object.assign(props, {'aria-hidden': 'true'})
Object.assign(props, {'aria-disabled': 'true', role: 'link'})
} else {
Object.assign(props, {
rel: 'prev',
Expand All @@ -163,7 +163,7 @@ export function buildComponentData(
key = 'page-next'
content = 'Next'
if (page.disabled) {
Object.assign(props, {'aria-hidden': 'true'})
Object.assign(props, {'aria-disabled': 'true', role: 'link'})
} else {
Object.assign(props, {
rel: 'next',
Expand Down

0 comments on commit b919972

Please sign in to comment.