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

Table: built-in Ctrl+A errors when "rows" parameter is defined #14634

Closed
horizoncarlo opened this issue Jan 25, 2024 · 7 comments · Fixed by #14675
Closed

Table: built-in Ctrl+A errors when "rows" parameter is defined #14634

horizoncarlo opened this issue Jan 25, 2024 · 7 comments · Fixed by #14675
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@horizoncarlo
Copy link

Describe the bug

Create a p-table with selectionMode="multiple" and [rows]="5" (or whatever number).

Select a row, then press Ctrl+A in an attempt to select the rest. Nothing happens and in the web console there is an error:
image

I've also seen "data is not iterable" from onKeyDown.

Environment

Basic app, running in Linux on Chrome or Firefox, with Ang/PrimeNG versions below.

Reproducer

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

Angular version

17.0.7

PrimeNG version

17.3.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

Node 20.9.0

Browser(s)

Chrome and Firefox

Steps to reproduce the behavior

From the StackBlitz example:

  1. Select a row
  2. Press Ctrl+A
  3. Nothing happens and there is an error in the console

If you remove [rows] from the p-table and try again it works as expected.

Expected behavior

Ctrl+A selects all the rows properly

@horizoncarlo horizoncarlo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 25, 2024
@mehmetcetin01140 mehmetcetin01140 self-assigned this Jan 31, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.5.0 milestone Jan 31, 2024
cetincakiroglu added a commit that referenced this issue Feb 1, 2024
Fixed #14634 - Table | Built-in Ctrl+A errors when rows parameter is …
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working LTS-16-PORTABLE and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 1, 2024
@quentin-ineat-ca
Copy link

@cetincakiroglu Error fixed in console but the selected lines are inexact, wrong fix.
Related to : #14463

@cetincakiroglu
Copy link
Contributor

@cetincakiroglu Error fixed in console but the selected lines are inexact, wrong fix.

Related to : #14463

Thanks for the feedback we'll check again.

@cetincakiroglu
Copy link
Contributor

Hi @quentin-ineat-ca ,

Ctrl + A selects all options in the current page and there isn't a console error. Could you please guide me to catch what's wrong with it?

@quentin-ineat-ca
Copy link

Hello @cetincakiroglu
With this exemple: https://stackblitz.com/edit/ty2zuu-6efrnz?file=package.json
I'm on mac and use cmd + a.

On apparence the selection is good but the actual selected rows are not good and they are duplicated.

If you click on first row (for exemple), cmd+a, you get 15 selected while only 10 on the page.
You click on another row, cmd+a, and the amount is again different.

@cetincakiroglu
Copy link
Contributor

cetincakiroglu commented Feb 2, 2024

Hi @quentin-ineat-ca ,

Thank you for helping me understand the problem and providing a new example. When the paginator is used, the selectAll function does not work properly. I have created a new issue and added it to the milestone. We will try to resolve this issue in version 17.6.0 #14700

@cetincakiroglu
Copy link
Contributor

We've investigated the issue and found that selectRange method needs a refactor. The behavior should be same as checkbox selection. We'll rewrite the select all logic for pSelectableRow. I'm moving this issue #14700 to the 17.Future milestone since the issue needs a meticulous study to be handled carefully. We'll take a look at it within the v17.

@quentin-ineat-ca
Copy link

Thank you for the follow up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants