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

Fix Pagination Previous Button Behavior #22007

Merged
merged 1 commit into from
Feb 1, 2025
Merged

Conversation

magicjar
Copy link
Contributor

Description

The calculation for currentPage in GetPreviousButtonAsync assumes that the TagHelper.Model.CurrentPage is always valid. If TagHelper.Model.CurrentPage becomes 0 or -1, the disabled class will not be applied correctly, leading to the Previous button being enabled even when it should be disabled.

Currently, the logic to disable the Previous button only considers whether CurrentPage == 1. There is no safeguard for invalid page values (e.g., 0, -1).

This bug only occurs on routes with an ID parameter, such as homepage.com/movie/{id}/reviews?currentPage=1, where {id} is used to fetch reviews for a specific movie. However, on the "movie" index route (homepage.com/movie?currentPage=1), the pagination renders correctly.

@CLAassistant
Copy link

CLAassistant commented Jan 26, 2025

CLA assistant check
All committers have signed the CLA.

@maliming maliming added this to the 9.2-preview milestone Feb 1, 2025
@maliming
Copy link
Member

maliming commented Feb 1, 2025

Thanks @magicjar

@maliming maliming merged commit 0a1c637 into abpframework:dev Feb 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants