protected override void Dispose(bool disposing) { if (disposing && Rendered) { // TODO: implement IAsyncDisposable once it is supported by Blazor! // // Sometimes user can navigates to another page based on the action runned on modal. The problem is // that for providers like Bootstrap, some classnames can be left behind. So to cover those situation // we need to close modal and dispose of any claassnames in case there is any left. _ = JSRunner.CloseModal(ElementRef, ElementId); } base.Dispose(disposing); }
private void HandleVisibilityStyles(bool visible) { if (visible) { ExecuteAfterRender(async() => { await JSRunner.OpenModal(ElementRef, ElementId); }); } else { ExecuteAfterRender(async() => { await JSRunner.CloseModal(ElementRef, ElementId); }); } DirtyClasses(); DirtyStyles(); }
private void HandleOpenState(bool opened) { // TODO: find a way to remove javascript if (opened) { ExecuteAfterRender(async() => { await JSRunner.OpenModal(ElementRef, ElementId); }); } else { ExecuteAfterRender(async() => { await JSRunner.CloseModal(ElementRef, ElementId); }); } StateChanged?.Invoke(this, new ModalStateEventArgs(opened)); DirtyClasses(); DirtyStyles(); }