Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add Page Number Value to Pagination Buttons #2948

Open
etanb opened this issue Jun 14, 2024 · 0 comments
Open

[feat] Add Page Number Value to Pagination Buttons #2948

etanb opened this issue Jun 14, 2024 · 0 comments
Labels
type: feature New feature or request

Comments

@etanb
Copy link

etanb commented Jun 14, 2024

Does your feature request relate to a specific USWDS component?

Pagination specifically: https://github.com/trussworks/react-uswds/blob/main/src/components/Pagination/Pagination.tsx

What USWDS Version is this feature present in?

ALL

Is your feature request related to a problem? Please describe.

As of now, the only way to get the value of which page a user clicked within a Pagination component is by the .innerText. We should not be storing and reading values based on DOM strings.

Describe the solution you'd like

Simply add a value={page} or data-page={page} with the actual page number value for better readability and structure:

https://github.com/trussworks/react-uswds/blob/main/src/components/Pagination/Pagination.tsx#L43-L54

@etanb etanb added the type: feature New feature or request label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant