79608513

Date: 2025-05-06 10:42:09
Score: 1
Natty:
Report link

This is because mat-select does not allow toggling multiple after the component has been initialized.To solve this, you must destroy the original field, create a copy with the modified multiple value, and re-insert it at the same index. After that, trigger Formly to re-render using this.fields = [...this.fields].

  1. this.fields = [...this.fields]; is critical to trigger Formly’s internal change detection. 2)this.cdr.detectChanges(); is optional but recommended in some cases (especially inside async logic
Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mayank Sharma