In the buttons added later events are not raised. Buttons are not removed. Example:
@page "/dialog01"
@using Syncfusion.EJ2.Blazor.Popups
@using Syncfusion.EJ2.Blazor.Buttons
<EjsButton @onclick="@OnBtnClick">Open Dialog</EjsButton>
<EjsDialog Width="320px" @bind-Visible="@DialogVisible" ShowCloseIcon="true" IsModal="true">
<DialogTemplates>
<Header> Update Required!!! </Header>
<Content> Would you like to install the latest updates? </Content>
</DialogTemplates>
<DialogButtons>
@if (altVisible)
{
<DialogButton ButtonModel="@DialogBtn" OnClick="@OnClicked"></DialogButton>
}
else
{
<DialogButton ButtonModel="@DialogNoBtn" OnClick="@OnClicked"></DialogButton>
}
</DialogButtons>
</EjsDialog>
@code {
public bool altVisible = false;
public bool DialogVisible { get; set; } = false;
public ButtonModel DialogBtn = new ButtonModel
{
Content = "Update",
IsPrimary = true
};
public ButtonModel DialogNoBtn = new ButtonModel
{
Content = "Later",
};
private void OnBtnClick()
{
altVisible = !altVisible;
this.DialogVisible = true;
}
private void OnClicked()
{
DialogVisible = false;
}
}
As a side note, not related to the previous problem, the dialog html is not removed from the DOM when the Component is disposed. After showing many dialogs the number of elements in the body keep increasing. Is the control in preview that has so many bugs?