Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

When reset the value to null, Select event triggers continuously in a loop

Sample Link                     : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Dropdownlist636817968

Code Snippet:

<div>

    <SfDropDownList
TValue="string"
Placeholder="e.g. Australia"
TItem="Countries"
DataSource="@Country"
@bind-Value="HierarchyVal">

        <DropDownListFieldSettings
Value="Name"></DropDownListFieldSettings>

        <DropDownListEvents
TValue="string"
TItem="Countries"
ValueChange="@onRowFilterHierarchyChange"
OnValueSelect="rowsSelectH"></DropDownListEvents>

    </SfDropDownList>

    <Syncfusion.Blazor.Buttons.SfButton
Content="Reset to Null"
@onclick="OnClick"></Syncfusion.Blazor.Buttons.SfButton>

</div>


@code
{

    public
string
HierarchyVal
{
get;
set;
}

    public
int
SelectEventCount
{
get;
set;
} = 0;


    public
void
OnClick()

    {

        HierarchyVal = null;

    }


    public
class
Countries

    {

        public
string
Name
{
get;
set;
}


        public
string
Code
{
get;
set;
}

    }


    List<Countries> Country = new List<Countries>

{

        new
Countries()
{
Name = "Australia"Code = "AU"
},

        new
Countries()
{
Name = "Bermuda"Code = "BM"
},

        new
Countries()
{
Name = "Canada"Code = "CA"
},

        new
Countries()
{
Name = "Cameroon"Code = "CM"
},

    };

    private async void onRowFilterHierarchyChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string,
Countries> args)

    {


        //Mig - Change

        //await localStorage.SetItemAsync("rowUserHierarchyFiltersCont", args.Value);


    }

    private async void rowsSelectH(Syncfusion.Blazor.DropDowns.SelectEventArgs<Countries> args)

    {


        this.SelectEventCount++;

       

    }




Replication Procedure:

1. Run the attached sample.
2.Navigate to FetchData page.
3. Choose any value from Dropdownlist.
4. Reset the value to null by clicking the button.

Expected            : Value should reset to null
Outcomes          : Selected value still shows and Select event triggers continuously in a loop causes memory leak.