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

Component: Multiselect onChange not called #14807

Closed
tsepton opened this issue Feb 14, 2024 · 3 comments · Fixed by #14826
Closed

Component: Multiselect onChange not called #14807

tsepton opened this issue Feb 14, 2024 · 3 comments · Fixed by #14826
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@tsepton
Copy link

tsepton commented Feb 14, 2024

Describe the bug

Using a the MultiSelect component, the onChange callback does not emit when selecting all values through the upper checkbox that serves as a shortcut to select/unselect all values.

Environment

Ubuntu 23.10
Angular v17
Primeng 17.3.2

Reproducer

No response

Angular version

17.0.7

PrimeNG version

17.3.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.16.1

Browser(s)

No response

Steps to reproduce the behavior

template:

<p-multiSelect
    [options]="mockupData"
    (onChange)="onChangeCallback($event)"
    (onSelectAllChange)="onSelectAllChangeCallback($event)"
></p-multiSelect>

typescript:

protected onChangeCallback(event: any): void {
      console.log(event) // called only when a particular value is checked or unchecked
      // selecting or deselecting all values through the shortcut checkbox does not call the line above
}

protected onSelectAllChangeCallback(event: any): void {
      console.log(event) // not called neither when selecting or deselecting all values through shortcut checkbox
}

Expected behavior

onChange (i.e. "Callback to invoke when value changes") and onSelectAllChange (i.e "Callback to invoke when all data is selected") events should emit as the upper checkbox is clicked or unclicked.

@tsepton tsepton added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 14, 2024
@jandersen-yahoo
Copy link

We are also experiencing this with any version higher than 16.6.0. Looking at the change log between 16.6.0 and 16.7.0, there were three commits with MultiSelect. One commit has to do with the checkbox in the header, which I assume is the select all functionality. Perhaps this is where the problem was introduced?

@mehmetcetin01140 mehmetcetin01140 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 Feb 16, 2024
@rosenthalj
Copy link
Contributor

Issue #14603 is the same issue as the first part of this issue : onChange (i.e. "Callback to invoke when value changes")

I created issue #14603 which is a partial duplicate of this issue. It only fixes the "onChange event" problem addressed in this issue

I created pull request #14604 which fixes only the onChange event problem

@rosenthalj
Copy link
Contributor

I created pull request #14826 which fixes this issue. PR #14826 supersedes PR #14604

@cetincakiroglu cetincakiroglu added this to the 17.8.0 milestone Feb 23, 2024
cetincakiroglu added a commit that referenced this issue Feb 23, 2024
…03_14252_14807

fixed #14807 #14252 #14603 - updated onToggleAll method to call onChange and onSelectAllChange
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
5 participants