1
votes

I have a front element like this :

<nui-checkbox *ngFor="let optionManual of searchManuals | async" size="small" shape="round" fill="outline"
      (nuiChange)="selectManualOption(optionManual.manualId, $event.detail.checked)"
      [checked]="search.manualId.indexOf(optionManual.manualId) > -1">
      <span slot="end" class="button-inner"><span class="product-code">{{ optionManual.productCode }}</span><span
          class="volume" *ngIf="optionManual.pmVolumeText"> {{ optionManual.pmVolumeText }}</span>
        <nui-pill> {{ optionManual.language }}</nui-pill>
      </span>
   <div class="button-effect"></div>
</nui-checkbox>

I have to add a new feature and this feature have to filter the array this.search.manualId.

But when I call my function to filter it, it's trigger the change of some checkboxes on the component nui-checkbox, because, I guess, the indexOf in the checked property is changing.

Any idea to solve this issue ?

how and when do you filter the search.manualId ? - Random
I use a new checkbox. In fact, when you arrive on the page all checkbox are checked but not the new one. And when I check my new checkbox, it's call my function to filter the array. - Malkom
You're checking all values matching search.manualId. So if you filter search.manualId, less checkboxes will be checked. I don't understand what different behavior do you wish ? - Random
In fact, I have 5 checkbox in my test, normally with the filter, only the fourth checkbox is unchecked but indeed the fourth and the fiveth checkboxes is unchecked. An I see in my console, that the function selectManualOption is trigger but my new function don't call it. - Malkom
the fourth and the fifth checkboxes sorry ;) - Malkom