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: Incorrect Input Attribute Transformation #15253

Closed
lothern opened this issue Apr 10, 2024 · 4 comments
Closed

Table: Incorrect Input Attribute Transformation #15253

lothern opened this issue Apr 10, 2024 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@lothern
Copy link

lothern commented Apr 10, 2024

Describe the bug

For two of the input properties on the table component there is an incorrect attribute transformation being applied.

The two inputs are:

/**
 * Map instance to keep the expanded rows where key of the map is the data key of the row.
 * @group Props
 */
@Input({ transform: booleanAttribute }) expandedRowKeys: { [s: string]: boolean } = {};
/**
 * Map instance to keep the rows being edited where key of the map is the data key of the row.
 * @group Props
 */
@Input({ transform: booleanAttribute }) editingRowKeys: { [s: string]: boolean } = {};

The type for each doesn't need a boolean attribute transformation as the type of the property is an object.

This causes a runtime error:

ERROR Error: Cannot create property '1' on boolean 'true'

Environment

Angular 17.3.3
PrimeNG 17.13.0

Reproducer

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

Angular version

17.3.3

PrimeNG version

17.13.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.2

Browser(s)

No response

Steps to reproduce the behavior

In provided reproducer:

  1. Click the row expansion button
  2. Observe the error in the console

Expected behavior

I expect to pass an object conforming to the type of these inputs and not have it transformed/interpreted as a boolean type.

@lothern lothern added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 10, 2024
@w0wka91
Copy link

w0wka91 commented Apr 10, 2024

Is there a quickfix for this issue? I am still not sure if this issue came through the angular or the primeng update.

@BGBRWR
Copy link
Contributor

BGBRWR commented Apr 11, 2024

#15243 fixes this.

@lothern
Copy link
Author

lothern commented Apr 12, 2024

Is there a quickfix for this issue? I am still not sure if this issue came through the angular or the primeng update.

Afraid not. I reverted back to PrimeNG 17.11.0 until this could be resolved.

@lothern
Copy link
Author

lothern commented Apr 22, 2024

This issue is resolved in 17.14.1.

Thank you!

@lothern lothern closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants