angular / angular/components

[Paginator] Does not update correctly when `pageSize` updated programatically

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

Description

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

#### What is the expected behavior?
When changing the `pageSize` attribute on a pager instance, the pager should immediately redraw the visible rows to match the new setting.

#### What is the current behavior?
The description text ("Items per page: 10") is updated, however the old number of rows still appear.

#### What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-pvrjd5

#### What is the use-case or motivation for changing an existing behavior?
Dynamically changing the number of rows (e.g. on page resize)

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 6.0.6, Material 6.4.1

#### Is there anything else we should know?
Calling `_changePageSize()` instead of changing the property works as expected.

Contributor guide

Open the contributing guide

Research direction

Start with the StackBlitz reproduction and compare direct pageSize assignment with _changePageSize(). Done means changing pageSize immediately redraws the visible rows while updating the items-per-page text, without requiring the private method.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.