[Pagination] Fix styling for Pagination buttons with tooltips #1277
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.
WHY are these changes introduced?
Fixes #1276
There's an issue with how the styling is applied to the previous and next buttons in the Pagination component.
The issue affects how
margin-left
andborder-radius
properties are applied to the buttons. Its assumed the buttons will be siblings, with the styling based onfirst-child
andlast-child
.As a result several styles aren't applied properly, for example, when a
nextTooltip
is specified, the next button gets styles for bothfirst-child
andlast-child
& doesn't receive the negativemargin-left
for:not(:first-child)
.There's also similar issues when a
previousTooltip
is present or both tooltips.Similarly there are issues with the
plain
buttons when they have tooltips.Here are screenshots of different combinations of
previousTooltip
&nextTooltip
before and after the changes in this PR are applied (code for button combinations below):Before:
After:
WHAT is this pull request doing?
This PR adds classes specific to both the previous and next buttons. The reason new classes were introduced is that we couldn't properly target the buttons without them (we would have had to target previous and next siblings if we continued to just use the
Button
class).How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:Has different combinations of previous/next buttons with/without tooltips to highlight the different issues present
🎩 checklist