six-webcomponents icon indicating copy to clipboard operation
six-webcomponents copied to clipboard

six-select component doesn't support null value form multiple selections

Open francoflores opened this issue 1 year ago • 0 comments

Six Webcomponents version

4.0.0

Steps to reproduce

<div [formGroup]="filterForm">
     <six-select
        formControlName="status"
        id="status"
        multiple
        clearable
      >
        <six-menu-item value="AUSTRALIA">Australia</six-menu-item>
           <six-menu-item value="BRAZIL">Brazil</six-menu-item>
           <six-menu-item value="CHINA">China</six-menu-item>
      </six-select>
</div>
import { Component, OnInit} from '@angular/core';
import { FormBuilder, FormGroup} from '@angular/forms';

export class InitialComponent implements OnInit {
   public filterForm: FormGroup;

   constructor(private formBuilder: FormBuilder) {}

   ngOnInit(): void {
      this.filterForm = this.formBuilder.group({
            status: [null],
       });
    }
}

What is expected?

No error on browser console

What is actually happening?

An error in browser console. Cannot read properties of null (reading 'length').

And browser doesn´t render the component.

System Info

No response

Any additional comments?

The app need to start six-select component with empty value as default. In old versions it worked with value:[null]. Now the way it works is with value: [[]]

francoflores avatar Feb 14 '24 10:02 francoflores