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

Component: Paginator. "Show All" option in dropdown always displayed first #17068

Closed
markuczy opened this issue Dec 16, 2024 · 3 comments · Fixed by #17101
Closed

Component: Paginator. "Show All" option in dropdown always displayed first #17068

markuczy opened this issue Dec 16, 2024 · 3 comments · Fixed by #17101
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@markuczy
Copy link

Describe the bug

When you use paginator with rowsPerPageOptions property you can display "All" option. However, it will always be displayed first even if you define it as last in rowsPerPageOptions.

<p-paginator 
    ...
    [rowsPerPageOptions]="[10, 20, 30, { showAll: 'All'}]" />

I would expect that the following snippet would result in 'All' option displayed last in dropdown.
You could probably simply not do unshift but just push 'All' option whenever someone puts it in rowsPerPageOptions - https://github.com/primefaces/primeng/blob/master/src/app/components/paginator/paginator.ts#L409

Environment

stackblitz

Reproducer

https://stackblitz.com/edit/stackblitz-starters-t6faqdch?file=src%2Fapp%2Fapp.component.html

Angular version

^18.2.0

PrimeNG version

^18.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

stackblitz

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@markuczy markuczy added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 16, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 16, 2024
@mertsincan mertsincan added this to the Future milestone Dec 16, 2024
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 16, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

qwadrox added a commit to qwadrox/primeng that referenced this issue Dec 17, 2024
@mertsincan mertsincan modified the milestones: Future, 19.0.2 Dec 25, 2024
@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Resolution: Help Wanted Issue or pull request requires extra help and feedback labels Dec 25, 2024
@mertsincan mertsincan linked a pull request Dec 25, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeNG Dec 25, 2024
@markuczy
Copy link
Author

@mertsincan New implementation is not what I would expect either. What if I want to display the "ALL" button first? I cannot do that anymore...

Instead of pushing it as last argument, is it possible to simply push all items in the same order?

@markuczy
Copy link
Author

That way users determine the order of the elements.

example 1: [rowsPerPageOptions]="[10, 20, 30, { showAll: 'All'}]" -> 'ALL' option displayed last
example 2: [rowsPerPageOptions]="[{ showAll: 'All'}, 10, 20, 30]" -> 'ALL' option displayed first
example 3: [rowsPerPageOptions]="[10, { showAll: 'All'}, 20, 30]" -> 'ALL' option displayed second

Example 3 is less likely to happen, however possible with easy change of implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants