Problems Since Release 3

I've modified a sample from the forum to repro a problem I'm experiencing:

@using Syncfusion.Blazor.Buttons;
@using Syncfusion.Blazor.Inputs;
@using Syncfusion.Blazor.DropDowns;

@(selectedValue.HasValue ? selectedValue.Value : 0)

   
   

AddOne

@code{
    private int? selectedValue;
    private void ValueChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs args)
    {
        Console.WriteLine($"VALUE CHANGE");
        selectedValue = args.Value;
        //StateHasChanged();
    }
    private void OnValueSelect(Syncfusion.Blazor.DropDowns.SelectEventArgs args)
    {
        Console.WriteLine($"VALUE SELECT");
        if (args.ItemData == null)
        {
            selectedValue = null;
        }
        else
        {
            selectedValue = args.ItemData.Code;
        }
        //StateHasChanged();

    }

    private void AddOne()
    {
        Console.WriteLine($"ADD VALUE");

        Country.Add(new Countries() { Name = "Jonah", Code = 74 });

        var copy = new System.Collections.ObjectModel.ObservableCollection();
        foreach (var thing in Country)
        {
            copy.Add(thing);
        }


        Country.Clear();
        foreach(var thing in copy.OrderBy(x=>x.Name))
        {
            Country.Add(thing);
        }




    }


    public class Countries
    {
        public string Name { get; set; }
        public int Code { get; set; }
    }

    private System.Collections.ObjectModel.ObservableCollection Country = new System.Collections.ObjectModel.ObservableCollection
    {
        new Countries() { Name = "Australia", Code = 1 },
        new Countries() { Name = "Bermuda", Code = 2 },
        new Countries() { Name = "Canada", Code = 3 },
        new Countries() { Name = "Cameroon", Code = 4 },
    };
}


1) Why does ValueChange never fire? 
2) Note that when you "click out" of the combo, the value is lost- this happens unless you enable AllowCustom.

I can't seem to paste my code in here, it gets mangled.  This is the missing code.



4 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team October 21, 2020 11:11 AM UTC

Hi Jonah, 


Greetings from Syncfusion support. 



We checked the reported requirement. We would like to notify you that AllowCustom property is true by default. The component will not accept custom values when you set the AllowCustom property to false. Also, if you enter the custom value and focus out the component, it will clear the typed value and trigger the change event. Since the property value is updated to a null value. This is controls default behavior. 


Please find the sample below, 




If we misunderstood your requirement, kindly share the more details about your requirement. 



Regards, 
Sevvandhi N 


Marked as answer

JC Jonah Coleman October 21, 2020 12:55 PM UTC

Thanks for the reply.  I'm not trying to enter custom properties.  In the example provided I have set AllowCustom to false, but you still cannot select an entry.  When you select a (non-custom) entry, then click out of the cell the cell is cleared and the value is set to 0.


JC Jonah Coleman October 21, 2020 12:59 PM UTC

You can see the behavior in this video:

http://somup.com/cY6rlPlsMw

I take it back, the value is not being set to 0 in this example (it is in my real application).

Also, you missed this question- why is the ValueChange event not being called?  I need to use this as the OnValueSelect event fires on each item when the arrow keys are used to navigate through the drop down list.  You can see in my video I bring up the console and ValueChange never fires.


SN Sevvandhi Nagulan Syncfusion Team October 22, 2020 08:38 AM UTC

Hi Jonah, 



Thanks for providing the detailed information. 


Queries:  I'm not trying to enter custom properties.  In the example provided I have set AllowCustom to false, but you still cannot select an entry.  When you select a (non-custom) entry, then click out of the cell the cell is cleared and the value is set to 0 & Also, you missed this question- why is the ValueChange event not being called?  I need to use this as the OnValueSelect event fires on each item when the arrow keys are used to navigate through the drop down list 


We checked the provided video and shared code example. We made sample with the provided code snippet and we cannot reproduce the mentioned issue. Here we have attached the ensured sample and video demonstration. Kindly check with the attached video and provide an issue replicating sample by modifying the below attached sample that will help us to further validate the issue and provide you with a better solution from our end. 





Video link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ScreenCapture_22-10-2020_1.55.46_PM_(2)-865314094



Regards, 
Sevvandhi N 


Loader.
Up arrow icon