fix(pagination-nav): add data-page attributes #6437
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
data-page
attribute to the page buttons and select options in the PaginationNav component. This is to follow the vanilla implementation (https://the-carbon-components.netlify.app/?nav=pagination-nav) and to give developers better access for advanced behaviour that relies on handling the DOM node (such as adding a custom css rule or otherdata-*
attributes.I'm so sorry for the extra request, @joshblack @aledavila! Our intended implementation was counting on
data-page
and yet somehow it slipped through my first PR.Changelog
New
data-page="<page-number>"
tobutton.bx--pagination-nav__page
andselect.bx--pagination-nav__page option
Testing / Reviewing
data-page
attribute holds the actual page number, not the index.