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!

0
Votes

Native onchange event in DatePicker component is not triggered after click the clear icon

Sample:

Replication procedure: 


1. Run the above sample.

2. Clear the input value using backspace key and type “10081994” and click outside.
3. The native change event is triggered and the output will be 10/08/1994.
4. Now clear the input value using clear icon and type “10081994” and click outside.
5. The change event is not triggered and the input is not parsed.


@using System.Globalization;


<SfDatePicker TValue="DateTime?" Value='@DateValue' Min='@MinDate' Max='@MaxDate' @onchange="@OnChange" Format="MM/dd/yyyy" ShowClearButton></SfDatePicker>


@code {

    public DateTime? DateValue { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 10);

    public DateTime MinDate { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 05);

    public DateTime MaxDate { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 27);


    public void OnChange(ChangeEventArgs args)

    {

        DateTime parsedDate;

        var result = DateTime.TryParseExact(args.Value.ToString(), "MMddyyyy", new CultureInfo("en-US"),

                             DateTimeStyles.None, out parsedDate);


        if (result)

        {

            DateValue = parsedDate;

        }

    }

}