angular / angular/components

[Paginator] Ability to manually update hasNextPage() return value

Open
#9,013 10 comments 12 reactions 0 assignees View on GitHub
area: material/paginator feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:

Feature request

#### What is the expected behavior?

Return value of hasNextPage() (or hasPreviousPage()) method can be updated manually by a property outside of pageSize and pageIndex.

#### What is the current behavior?

Calculates return value based on pageSize and pageIndex

#### What is the use-case or motivation for changing an existing behavior?

In the event when the pageSize/length passed is not an accurate representation of the true length but an estimated length (when data is sent via the server). In this case, useful to be able to determine hasNextPage() method based on whether or not the server determines a next page exists. Otherwise, paginator will either allow nextPage events to fire when an empty query is returned or disallow pagination when more data can be queried.

Contributor guide

Open the contributing guide

Research direction

Start with the paginator's hasNextPage() and hasPreviousPage() entry points and trace how pageSize and pageIndex determine their results. Review the issue's server-side estimated-length use case and the existing comment discussion; done means the API and behavior clearly support server-provided page-boundary information without breaking current pagination behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.