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

Multiselect on chips display does not update the model when deleting them from the chip icon #9579

Closed
gxenakis opened this issue Nov 26, 2020 · 6 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@gxenakis
Copy link

I'm submitting a
[X] bug report

Current behavior
On chips display when you delete a chip by clicking the X button the model doesn't refresh

Expected behavior
Model should be refreshed like when you unclick from the dropdown list.

Minimal reproduction of the problem with instructions
https://primeng-multiselect-demo.stackblitz.io/

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 30, 2020
@yigitfindikli yigitfindikli self-assigned this Nov 30, 2020
@yigitfindikli yigitfindikli added this to the 11.0.1 milestone Nov 30, 2020
@tvbowersz
Copy link

Also discovered this when I was implementing it. Tried both using the formControlName inside of a reactive form as well as just binding with NgModel. Neither updated the model when removing items using the x inside of the chip

@andriy101
Copy link
Contributor

andriy101 commented Dec 6, 2020

Here is a question at StackOverflow and here is my workaround, Actually, what is missing is this.onModelChange(this.value); call at removeChip() function

andriy101 pushed a commit to andriy101/primeng that referenced this issue Dec 6, 2020
@Timmeeeey
Copy link

Besides from that the onChange event is not called/emitted when removing a chip.
I don't know if I should open another issue for this or if it fits in here.

@andriy101
Copy link
Contributor

No need to open a new issue, my pull request fixes this current issue for both template druiven and reactive forms

@Timmeeeey
Copy link

@andriy101
this.onModelChange(this.value); is not emitting onChange. It is only emitted by onOptionClick(event) and toggleAll(event).

@yigitfindikli yigitfindikli modified the milestones: 11.0.0-Final, 11.0.1 Dec 7, 2020
andriy101 added a commit to andriy101/primeng that referenced this issue Dec 8, 2020
@andriy101
Copy link
Contributor

@andriy101
this.onModelChange(this.value); is not emitting onChange. It is only emitted by onOptionClick(event) and toggleAll(event).

I added onChange emit with new value and the mouse event passed from the template via (click) function.

@yigitfindikli yigitfindikli 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 Dec 29, 2020
yigitfindikli added a commit that referenced this issue Dec 29, 2020
nnfedorov added a commit to nnfedorov/primeng that referenced this issue Aug 31, 2023
nnfedorov added a commit to nnfedorov/primeng that referenced this issue Sep 29, 2023
nnfedorov added a commit to nnfedorov/primeng that referenced this issue Oct 6, 2023
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
Development

No branches or pull requests

5 participants