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

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

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

linkdotnet opened this issue Oct 16, 2024 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

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:

[email protected]: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
@cetincakiroglu cetincakiroglu added this to the 18.0.0-rc.1 milestone Oct 26, 2024
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan removed this from PrimeNG Nov 20, 2024
mehmetcetin01140 added a commit that referenced this issue Nov 22, 2024
Fixed #16559 | p-buttonGroup throws console errors when styleClass is…
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Nov 22, 2024
@mehmetcetin01140 mehmetcetin01140 closed this as completed by moving to Done in PrimeNG Nov 22, 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

4 participants