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 when closing modal with date picker or combo box

Hello,

When closing a modal containing either a combo box or date picker (or both) I get the following error - TypeError: Cannot read property 'ej2_instances' of null. I think this is a general issue since I have reported something similar and you fixed it. My code is:

@page "/counter"
@using Syncfusion.EJ2.Blazor.DropDowns
@using Data
@using Syncfusion.EJ2.Blazor.Popups
@using Syncfusion.EJ2.Blazor.Calendars

@this.ComboBoxValue



@if (this.IsModalShown == true)
{
   
       
           
           
               

               
           
       
       
           
           
               
                   
                       
                   
               
           
       
       
   
}


@code
{
    public ComboBoxFieldSettings ComboBoxFieldSettings { get; set; } = new ComboBoxFieldSettings() { Text = "ShipCity", Value = "ShipCity" };

    public bool IsModalShown { get; set; }

    public object ComboBoxValue { get; set; }

    public DateTime? Deadline { get; set; }
}



4 Replies

KI Krasimir Ivanov July 12, 2019 09:49 AM UTC

For some reason my code is being posted in a strange way after editing. I will post it here again: 

@page "/counter"
@using Syncfusion.EJ2.Blazor.DropDowns
@using Data
@using Syncfusion.EJ2.Blazor.Popups
@using Syncfusion.EJ2.Blazor.Calendars

@this.ComboBoxValue

<button @onclick=@(() => this.IsModalShown = true)>Open Modal</button>


@if (this.IsModalShown == true)
{
    <EjsDialog id="dialog" header=@("Modal") width="800px" isModal="true" allowDragging="true">
        <div class="form-group row">
            <label for="Select" class="col-2 col-form-label">Select:</label>
            <div class="col-4">
                <EjsComboBox AllowCustom="true" AllowFiltering="true" @bind-value=this.ComboBoxValue DataSource=@OrdersDetails.GetAllRecords() PlaceHolder="Select an city" Fields=@this.ComboBoxFieldSettings>

                </EjsComboBox>
            </div>
        </div>
        <div class="form-group row">
            <label for="Deadline" class="col-2 col-form-label">Deadline:</label>
            <div class="col-4">
                <div id="wrapper" class="datepicker-section">
                    <div id="datepicker-control">
                        <EjsDatePicker id="datepicker" placeholder="Choose a Date" @bind-value=@this.Deadline></EjsDatePicker>
                    </div>
                </div>
            </div>
        </div>
        <button @onclick=@(() => this.IsModalShown = false)>Close</button>
    </EjsDialog>
}


@code
{
    public ComboBoxFieldSettings ComboBoxFieldSettings { get; set; } = new ComboBoxFieldSettings() { Text = "ShipCity", Value = "ShipCity" };

    public bool IsModalShown { get; set; }

    public object ComboBoxValue { get; set; }

    public DateTime? Deadline { get; set; }
}



BS Buvana Sathasivam Syncfusion Team July 15, 2019 01:00 PM UTC

Hi Ivan,  
Good Day to you. 
Thanks for using Syncfusion products, From your shared code snippet, we were able to reproduce your issue. Currently we are validating your issue and will update further on this by tomorrow (07/16/19). Until then we suggest you to use Visible API to show and hide dialog in the button click.  
Regards,  
Buvana S 



BS Buvana Sathasivam Syncfusion Team July 16, 2019 01:36 PM UTC

Hi Ivan, 

Thanks for your patience. 

We have validated the reported issue in “Destroy throws issue when we integrate other Blazor component inside Dialog” at EJ2 Dialog control, and we are considering this as a defect in our end. The fix for the issue will be included in our next NuGet release on end of July. 
  
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link:  


Regards, 
Buvana S 
 



PM Pandiyaraj Muniyandi Syncfusion Team September 4, 2019 08:08 AM UTC

Hi Ivan, 
 
Thanks for your patience.  
 
The reported issue Destroy throws issue when we integrate other Blazor component inside Dialog” has been fixed and included in the patch release version 17.2.49-beta. Also, we have prepared sample for your reference, get it from below link 
 
We suggest you, upgrade to the latest version to resolve this issue in your end. 
 
Regards, 
Pandiyaraj M 



Loader.
Live Chat Icon For mobile
Up arrow icon