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

p-buttonGroup throws console errors when styleClass is applied #16559

Open
linkdotnet opened this issue Oct 16, 2024 · 0 comments
Open

p-buttonGroup throws console errors when styleClass is applied #16559

linkdotnet opened this issue Oct 16, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@linkdotnet
Copy link

Describe the bug

Clicking buttons inside a button group leads to console errors. See either stackblitz example below or this simplified example:

<p-buttonGroup pStyleClass="flex">
  <p-button
    class="flex flex-grow"
    styleClass="flex-grow"
    [label]="primaryLabel"
    severity="primary"
    (onClick)="primaryClicked.emit()"
  ></p-button>
  <p-button
    class="flex-grow-0"
    severity="secondary"
    label="x"
    (onClick)="secondaryClicked.emit()"
  >
  </p-button>
</p-buttonGroup>

When clicking on one of the buttons, will lead to the following console error:

.localservice@runtime.134daa3c.js:26 ERROR TypeError: Cannot read properties of null (reading 'offsetParent')
    at _StyleClass.clickListener (primeng_styleclass.js?v=52dd93ed:123:23)
    at StyleClass_click_HostBindingHandler (primeng_styleclass.js?v=52dd93ed:281:22)
    at executeListenerWithErrorHandling (chunk-W5QGBK3I.js?v=52dd93ed:20172:12)
    at wrapListenerIn_markDirtyAndPreventDefault (chunk-W5QGBK3I.js?v=52dd93ed:20192:18)
    at HTMLElement.<anonymous> (chunk-HNFVE3SF.js?v=52dd93ed:2981:112)
    at _ZoneDelegate.invokeTask (zone.js:402:33)
    at chunk-W5QGBK3I.js?v=52dd93ed:8574:49
    at AsyncStackTaggingZoneSpec.onInvokeTask (chunk-W5QGBK3I.js?v=52dd93ed:8574:30)
    at _ZoneDelegate.invokeTask (zone.js:401:38)
    at Object.onInvokeTask (chunk-W5QGBK3I.js?v=52dd93ed:8764:25)

(Copy&Pasted from the stackblitz example).

This happens only when a button inside a buttonGroup is clicked.

Environment

Reproducer

https://stackblitz.com/edit/stackblitz-starters-1zfded

Angular version

18.1

PrimeNG version

18.0.0-beta.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.3

Browser(s)

Chrome

Steps to reproduce the behavior

Clicking a button inside a button-group where the p-buttonGroup has a styleClass.

Expected behavior

No response

@linkdotnet linkdotnet added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 16, 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

1 participant