fix(module: Pagination): Pager 3 and 5 may be invisible when window width is small and there're many pages #2616
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.
🤔 This is a ...
🔗 Related issue link
Fixes #2124
💡 Background and solution
There're several issues with Pagination component, some are invisible, while some are affecting user experience under small screens
class="ant-pagination-item-after-jump-prev ant-pagination-item ant-pagination-item-5 ant-pagination-item-after-jump-prev"
before-jump-next
instead ofafter-jump-prev
ant-pagination-item-after-jump-prev
, which is redundantClick Page 5, we can see that PaginationPager 5 still holds
ant-pagination-item-after-jump-prev
class, which is unexpectedThen click Page 3, both PaginationPager 3 and 5 holds
ant-pagination-item-after-jump-prev
class, so they'll disappear when the screen width is small.So, fixes:
if (itemBeforeJumpNext)
Class="@($"{PrefixCls}-item-before-jump-next")"
PaginationPager.OnInitialized()
, remove redundant adding of class itself toClassMapper
againpagerList
, explicitly setClass=""
Tested locally, class for each pager is set properly,
and we can see pager 5 when it's selected on small screen width now.
📝 Changelog
☑️ Self Check before Merge