-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(paginator): allow page size selection to be disabled #8373
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
Conversation
src/lib/paginator/paginator.ts
Outdated
@@ -96,6 +96,9 @@ export class MatPaginator implements OnInit, OnDestroy { | |||
} | |||
private _pageSizeOptions: number[] = []; | |||
|
|||
/** Whether to show the page size selection UI to the user. */ | |||
@Input() pageSizeEnabled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewseguin I was torn between doing this and having some logic where the select is hidden if you pass in an empty array of options. I went with this since it's a bit more obvious what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment an empty array will display a label (whereas if there are several elements, it will display a dropdown) so I think overwriting the current behaviour wouldn't have been a good idea.
@crisbeto btw, thanks for the fast response to the issue.
Sorta conflicted on this one - seems like an easy CSS How do you feel about renaming as |
7eef0c6
to
2904ced
Compare
Renamed to |
@crisbeto Could you please fix the tests? Thanks |
2904ced
to
1e062f3
Compare
I think those failures were coming in from master @tinayuangao. I've rebased it against the current master. |
Can you verify that the tests are actually passing? |
Adds an input that allows the consumer to disable the page size selection entirely. Fixes angular#8359.
1e062f3
to
d5937c9
Compare
Sorted out the paginator failures, there are still some failures from master, but they're unrelated. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds an input that allows the consumer to disable the page size selection entirely.
Fixes #8359.
Note: the AoT compilation error is coming from master and will be fixed in another PR.