You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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}
ordata-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
The text was updated successfully, but these errors were encountered: