function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hema YejjuHema Yejju 

How to deselect all the values in previous selection which the values are coming from lightning combobox

 <lightning-combobox
            name="Loc picklist"
            label="Location"
            value={selectedLoc}
            options={objects}
            onchange={handleChange}
            dropdown-alignment="auto"
          >
          </lightning-combobox>


 <lightning-combobox
         name="Unit"
         label="Sales Unit"
         value={selectedUnit}
         options={suObjects}
         onchange={handleChange}
         dropdown-alignment="auto"
        >
        </lightning-combobox>
__________________________________________________


handleChange(event) {
        console.log("value :" + event.detail.value);

        let fieldname = event.target.name;
      
        console.log('fieldname ::here'+fieldname);
        var pickListValue = event.detail.value;
        
        
        if(fieldname=='Loc picklist'){
        
        
        if(pickListValue!=null){

          
          var selloc =pickListValue;
         
          this.selectedLoc=selloc; 
         console.log('allData in handle change'+this.allData); 

        
          const uniqueSet = new Set();
          let obj1 = [];
          
          for(let i=0; i<this.allData.length; i++){

           
            if(this.allData[i].location==selloc && this.allData[i].sUnit){

                console.log(JSON.stringify( this.allData[i].sUnit));
                if(!uniqueSet.has(this.allData[i].sUnit)){
                    console.log(JSON.stringify( this.allData[i].sUnit));
                    const option = {
               
                        label: this.allData[i].sUnit, 
                        value: this.allData[i].sUnit  
                    };

                    obj1.push(option);
                    
                } 
                uniqueSet.add(this.allData[i].sUnit); 
            
            }
           
          }
          this.suObjects = obj1;

         

        }
    } 


I have 3 combobox where in if i select 1st combobox picklist value then 2 picklist  combobox value will appear  and then 3rd..

Now if  i change 1st combox picklist value then 2nd and 3rd picklist values which are previously selected should be black .

plz suggest me here