Hello,
I'm working on a Blazor Server project using:
SyncFusion.Blazor 18.2.0.54
SyncFusion.Blazor.PdfViewerServer.Windows 18.2.0.54
I have a PDF Viewer inside a modal Dialog, like this:
<SfDialog @ref="@dialog" Target="#pdftarget" Width="1280px" Visible="false" IsModal="true" Header="Visor de Documentos" ShowCloseIcon="true">
<DialogEvents OnOpen="OnOpen" OnClose="OnClose"></DialogEvents>
<DialogPositionData X="center" Y="top"></DialogPositionData>
<SfPdfViewerServer @ref="@viewer" ToolbarSettings="@ToolbarSettings" Height="100%" />
</SfDialog>
@code{
SfPdfViewerServer viewer;
SfDialog dialog;
public PdfViewerToolbarSettings ToolbarSettings = new PdfViewerToolbarSettings()
{
ToolbarItems = new List<ToolbarItem>()
{
ToolbarItem.PageNavigationTool,
ToolbarItem.MagnificationTool,
ToolbarItem.SearchOption,
ToolbarItem.PrintOption,
ToolbarItem.DownloadOption
}
};
private async void onClickVerPdf()
{
await this.dialog.Show();
}
public async void OnOpen(Syncfusion.Blazor.Popups.BeforeOpenEventArgs args)
{
await viewer.Load(path, null); //path is a variable where I tell the viewer where is the pdf file
}
private async void OnClose(BeforeCloseEventArgs args)
{
await viewer.Unload();
}
}
It's working fine....After the dialog appears, the pdf file is loaded correctly.
But when I close de Dialog, I get this message in the browser console:
POST https://localhost:44303/undefined/Unload 400
at https://localhost:44303/_content/Syncfusion.Blazor/scripts/pdfviewer-a1eb99.min.js
I attach a zip with the browser console error (text and image)
Inspecting the file pdfviewer-a1eb99.min.js I think the error is produced here:
try {
if ("keepalive" in new Request("")) {
var s = this.setUnloadRequestHeaders();
fetch(window.sessionStorage.getItem("serviceURL") + "/" + o, {
method: "POST",
headers: s,
body: JSON.stringify(n)
})
}
} catch (t) {
this.unloadRequestHandler = new Qt(this.pdfViewer), this.unloadRequestHandler.send(n)
}
Is there someting I can do to fix this issue?
Thanks!!!
Attachment:
Erorr_PdfViewer_after_Dialog_close_5dc797c2.zip