We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

error in chip

Hi.Please look at the attachment file.
@using Syncfusion.EJ2.Blazor.Inputs
@page "/"
<EjsNumericTextBox TValue="int" @bind-Value =@NumericValue></EjsNumericTextBox>
<CascadingValue Value="@NumericValue">
    <Chip></Chip>
</CascadingValue>
@code {

    public int NumericValue { get; set; } = 5;
}
------------------------------------------------------------------------------------------------------------------
<EjsChipList Selection="Selection.Single" EnableRtl="true">
    <ChipCollection>
        @if (dataSource > 0)
        {
            @for (int i = 0; i <= dataSource; i++)
            {

                <ChipListChip Text="@(i.ToString().PadLeft(2, '0'))">


                </ChipListChip>
            }

        }
    </ChipCollection>
</EjsChipList>
@code{
    [CascadingParameter]
    public int dataSource { get; set; }
}

Attachment: chipError_8e230b33.zip

5 Replies

SP Sowmiya Padmanaban Syncfusion Team January 27, 2020 12:34 PM UTC

Hi Ebi,  

We have checked your reported query to adding more than two items dynamically. We are able to reproduce the issue from our end. We might consider this as a bug from our end. This bug fix will be included in our Volume 4 SP1 Release which is expected to be released at the end of January. Please be patience, until then. 
 
 
Please let us know, if you need any further assistance on this. 

Regards,  
Sowmiya.P 



ET ebi torabi January 30, 2020 07:11 AM UTC

Hi Sowmiya.P.
Has this issue been fixed in version 17.4.46



SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team January 31, 2020 07:23 AM UTC

Hi Ebi, 
 
We are glad to announce that our Essential Studio 2019 Volume 4 Service Pack release v17.4.0.46 is rolled out and is available for download under the following link. 
 
  
In this release, we have included a fix for “Dynamically add more than one chip items to Chip component”. 
 
For your reference, we have prepared a simple sample. Refer the sample link below. 
 
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Shameer Ali Baig S. 



ET ebi torabi February 1, 2020 06:42 AM UTC

Hi Shameer Ali Baig S.Thank you very much. 
But it is possible for all chips to be built dynamically.


That is, delete the following line
.
.
.
 <ChipListChip Text="text"></ChipListChip>
.
.
.


SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team February 3, 2020 07:27 AM UTC

Hi Ebi, 
 
Thanks for the update. 
 
For your information, if no chip collection is not added on initial rendering, then Chip component will render with a single chip item. It is the default behavior of the component. Thus, we cannot render empty Chip on initial rendering, to add the Chip list dynamically. 
 
Though, to achieve your expected requirement, you can initialize the Chip control without adding any text and add styles for empty chip (display as none) to hide the initially rendered empty Chip. Then, you can dynamically add the Chip items on user input. 
 
 
Refer the below code block. 
 
 
<EjsChipList @ref="chip" EnableDelete="true" CssClass="custom"> 
    <ChipCollection> 
        <ChipListChip></ChipListChip> 
    </ChipCollection> 
</EjsChipList> 
 
@code{ 
    EjsButton ToggleBtn; 
    EjsTextBox textbox; 
    EjsChipList chip; 
 
    public void onToggleClick() 
    { 
        var value = this.textbox.Value; 
        ChipModel chips = new ChipModel(); 
        chips.Text = value; 
        chip.Add(chips); 
    } 
 
} 
 
<style> 
    .e-chip-list .custom.e-chip:first-child { 
        display: none; 
    } 
</style> 
 
 
We have also prepared sample for your convenience.  
 
 
Please let us know, if you need any assistance. 
 
Regards, 
Shameer Ali Baig S. 


Loader.
Live Chat Icon For mobile
Up arrow icon