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

MatPaginator doesn't emit PageEvent when pageIndex is altered programmatically #12620

Closed
snebjorn opened this issue Aug 10, 2018 · 2 comments
Closed

Comments

@snebjorn
Copy link

Bug, feature request, or proposal:

Bug.

What is the expected behavior?

When

@Input()
pageIndex: number

changes

@Output()
page: EventEmitter<PageEvent> // from doc: Event emitted when the paginator changes the page size or page index.

should emit a PageEvent.

What is the current behavior?

No PageEvent is emitted.

What are the steps to reproduce?

Component:

@ViewChild(MatPaginator) paginator: MatPaginator;

ngAfterViewInit(): void {
    this.paginator.page.subscribe(x => console.log(x));
  }

test() {
    this.paginator.pageIndex = 42;
  }

View
<button (click)="test()">TEST</button>

Clicking the button should result in a PageEvent being written to the console. But nothing happens

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

According to the documentation an event should be emitted when either page size or page index changes.

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

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.1.2
Node: 9.10.1
OS: win32 x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.7.1
@angular-devkit/build-angular     0.7.1
@angular-devkit/build-optimizer   0.7.1
@angular-devkit/build-webpack     0.7.1
@angular-devkit/core              0.7.1
@angular-devkit/schematics        0.7.1
@angular/cdk                      6.4.2
@angular/cli                      6.1.2
@angular/flex-layout              6.0.0-beta.17
@angular/material                 6.4.2
@ngtools/webpack                  6.1.1
@schematics/angular               0.7.2
@schematics/update                0.7.2
rxjs                              6.2.2
typescript                        2.9.2
webpack                           4.9.2
@crisbeto
Copy link
Member

Will be resolved by #12586.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants