Skip to content

CascadeSelect: onChange event fires unexpectedly on component initialization #17525

Closed
@itismohammadreza

Description

@itismohammadreza

Describe the bug

The onChange output event is firing automatically when the component initializes, instead of only triggering when a user interaction occurs

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/mjbmhva7?file=src%2Fapp%2Fimports.ts,src%2Fapp%2Fcascade-select-invalid-demo.html,src%2Fapp%2Fcascade-select-invalid-demo.ts

Environment

windows

Angular version

19

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Add the component with an onChange handler.
  2. Observe that the handler executes immediately on load, without any user interaction.

Expected behavior

The onChange event should only fire when the value actually changes due to user input.

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions