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

Checkbox: breaking change for value type #13182

Closed
IvanFeric opened this issue Jun 12, 2023 · 0 comments
Closed

Checkbox: breaking change for value type #13182

IvanFeric opened this issue Jun 12, 2023 · 0 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@IvanFeric
Copy link

Describe the bug

As part of the commit 619c52b that added types to various Checkbox properties, there was a breaking change where the type of value property changed from any to string | object | boolean | undefined | null.

I'm working on upgrading our app to Angular 16 and, because of that, I need to upgrade PrimeNg to 16 as well (OT: I wonder when the non-RC version will arrive). In our app, we have a lot of checkboxes that are based on enum, and the value we're assigning to the value is of that enum type. Our enum has values that are of type number which is not one of the allowed types for the value property. Prior to this change, everything worked correctly while now we can't compile the app without casting the enum value to any.

Environment

Angular 16.0.4 with PrimeNg 16.0.0-rc.2 and TypeScript 5.0.4

Reproducer

No response

Angular version

16.0.4

PrimeNG version

16.0.0-rc.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Create enum type. For example:
enum DayOfWeek {
  Sunday = 0,
  Monday = 1,
  Tuesday = 2,
  Wednesday = 3,
  Thursday = 4,
  Friday = 5,
  Saturday = 6
}
  1. Add PrimeNg checkbox with value set to one of the enum values and one checkbox with number value. For example:
<p-checkbox [value]="DayOfWeek.Sunday"></p-checkbox>
<p-checkbox [value]="42"></p-checkbox>
  1. Try to compile

Expected behavior

Checkbox control should work with both enum and number values

@IvanFeric IvanFeric added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 12, 2023
@cetincakiroglu cetincakiroglu added this to the 16.0.1 milestone Jun 16, 2023
@cetincakiroglu cetincakiroglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels Jun 16, 2023
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

No branches or pull requests

2 participants