You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Multiselect PrimeNg component, with a custom pTemplate="selectedItems" if you want to reset the form, the value of the field is cleared, but the options remain even if they don't appear, they still are present in the component as selectedOptions. When using Array of string instead of Array of objects as the data of the Multiselect, the field doesn't get cleared, and values still show up.
The form is a Reactive Form.
When you get the Multiselect elements and clear the selectedOptions programatically, the fields get cleared as expected.
Selecting values :
Reset ko :
Reset ok :
Environment
Regular Angular CLI project with Angular 16 and PrimeNg 16, primeflex.
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
May 14, 2024
mehmetcetin01140
added
Resolution: Invalid
Issue or pull request is not valid in the latest version
and removed
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
labels
May 16, 2024
Describe the bug
When using the Multiselect PrimeNg component, with a custom
pTemplate="selectedItems"
if you want to reset the form, the value of the field is cleared, but the options remain even if they don't appear, they still are present in the component asselectedOptions
. When using Array of string instead of Array of objects as the data of the Multiselect, the field doesn't get cleared, and values still show up.The form is a Reactive Form.
When you get the Multiselect elements and clear the selectedOptions programatically, the fields get cleared as expected.
Selecting values :
Reset ko :
Reset ok :
Environment
Regular Angular CLI project with Angular 16 and PrimeNg 16, primeflex.
Reproducer
https://stackblitz.com/edit/primeng-dropdown-demo-gjw8xm
Angular version
16.2.12
PrimeNG version
16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16+
Browser(s)
Chrome 122
Steps to reproduce the behavior
In the Stackblitz :
reset ko
reset ok
DOM inspection on the first field :
Expected behavior
On FormGroup reset, the fields should both be cleared of value, but also of display.
The text was updated successfully, but these errors were encountered: