primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Checkbox: Checkbox multiselect doesn't work with reactive form and formcontrol

Open PR4SAN opened this issue 1 year ago • 1 comments

Describe the bug

when implementing checkbox group selection with reactive forms and formcontrolname only the last element is saved in the value array while it should be all the selected items.

Environment

happening all the environments

Reproducer

https://stackblitz.com/edit/b2xqfx?file=src%2Fapp%2Fdemo%2Fcheckbox-dynamic-demo.html

Angular version

17.3.1

PrimeNG version

17.13.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.18.0

Browser(s)

Microsoft Edge Version 123.0.2420.97 (Official build) (64-bit)

Steps to reproduce the behavior

use formcontrolname for multi-select checkbox group. attached stackblitz link

Expected behavior

formcontrol should have array of selected items instead of last selected item.

PR4SAN avatar Apr 12 '24 12:04 PR4SAN

Hi, any updates here? this is a production-level bug-breaking application. can we have some updates here?

PR4SAN avatar May 02 '24 16:05 PR4SAN

@PR4SAN

Hi, this issue is not present in the latest version of PrimeNG (17.17.0). Please try it with the latest version. I'm closing the issue.

mehmetcetin01140 avatar May 22 '24 08:05 mehmetcetin01140

This issue might be relevant to LTS versions too. For now we have to patch it with yarn. Take inspiration from this https://github.com/primefaces/primeng/commit/7ed5f1f3e417605bce5a8d16e79a016bd96c7ef2

john8329 avatar Sep 14 '24 09:09 john8329