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

Error when [showButtonBar]="true" is applied to the datepicker component #17125

Closed
lucas-mota-gomes opened this issue Dec 18, 2024 · 2 comments
Closed
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@lucas-mota-gomes
Copy link

lucas-mota-gomes commented Dec 18, 2024

Describe the bug

When enabling the [showButtonBar]="true" property on the datepicker component, the following error occurs:

ERROR Error: NgClass can only toggle CSS classes expressed as strings, got undefined at _NgClass._toggleClass (common.mjs:3012:15) at _NgClass._applyStateDiff (common.mjs:2996:14) at _NgClass.ngDoCheck (common.mjs:2973:10) at callHookInternal (core.mjs:4166:10) at callHook (core.mjs:4193:5) at callHooks (core.mjs:4150:9) at executeInitAndCheckHooks (core.mjs:4105:5) at selectIndexInternal (core.mjs:12624:9) at ɵɵadvance (core.mjs:12608:3) at DatePicker_div_3_div_6_Template (primeng-datepicker.mjs:1985:8)

Environment

Library Version: [v19.0.0]
Angular Version: [v19.0.3]

Additional Context:
If the [showButtonBar] property is set to false, the error does not occur.

Reproducer

No response

Angular version

19.0.3

PrimeNG version

19.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.11.0

Browser(s)

Edge

Steps to reproduce the behavior

  1. Use the datepicker component with [showButtonBar]="true".
  2. Open the datepicke

Expected behavior

The datepicker should display the button bar without error

Actual Behavior:
An error is thrown in the console and the button bar does not render properly.

@lucas-mota-gomes lucas-mota-gomes 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 18, 2024
@Delagen
Copy link

Delagen commented Dec 18, 2024

Seems this is issue: 61a7891#diff-40c9e8900181657297f7c0b31d5fee5a96cd1c1704f1d9f406b3bfcd8b1022a9R493

ngClass values wrapped in square brackets, that by default results in [undefined] and undefined is invalid value for class

@Delagen
Copy link

Delagen commented Dec 18, 2024

Workaround, set any classes for this buttons

    [todayButtonStyleClass]="'btn-bar-today'"
    [clearButtonStyleClass]="'btn-bar-clear'"

@mertsincan mertsincan added 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 labels Dec 19, 2024
@mertsincan mertsincan added this to the 19.0.1 milestone Dec 19, 2024
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 19, 2024
mertsincan added a commit that referenced this issue Dec 19, 2024
mertsincan added a commit that referenced this issue Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeNG Dec 19, 2024
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
Status: Done
Development

No branches or pull requests

3 participants