I have a list view page where I have a datagrid control which shows records from a custom model. One of the columns I use a custom template with a a ref which navigates to the details page:
When I click on the a ref to navigate to my details page, I get the following error when loading the new page.
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Cannot read property 'querySelector' of null
TypeError: Cannot read property 'querySelector' of null
at Object.focus (https://localhost:44349/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:118297)
at https://localhost:44349/_framework/blazor.server.js:8:31619
at new Promise (<anonymous>)
at e.beginInvokeJSFromDotNet (https://localhost:44349/_framework/blazor.server.js:8:31587)
at https://localhost:44349/_framework/blazor.server.js:1:20052
at Array.forEach (<anonymous>)
at e.invokeClientMethod (https://localhost:44349/_framework/blazor.server.js:1:20022)
at e.processIncomingData (https://localhost:44349/_framework/blazor.server.js:1:18006)
at e.connection.onreceive (https://localhost:44349/_framework/blazor.server.js:1:11091)
at WebSocket.i.onmessage (https://localhost:44349/_framework/blazor.server.js:1:39007)
Microsoft.JSInterop.JSException: Cannot read property 'querySelector' of null
TypeError: Cannot read property 'querySelector' of null
at Object.focus (https://localhost:44349/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:118297)
at https://localhost:44349/_framework/blazor.server.js:8:31619
at new Promise (<anonymous>)
at e.beginInvokeJSFromDotNet (https://localhost:44349/_framework/blazor.server.js:8:31587)
at https://localhost:44349/_framework/blazor.server.js:1:20052
at Array.forEach (<anonymous>)
at e.invokeClientMethod (https://localhost:44349/_framework/blazor.server.js:1:20022)
at e.processIncomingData (https://localhost:44349/_framework/blazor.server.js:1:18006)
at e.connection.onreceive (https://localhost:44349/_framework/blazor.server.js:1:11091)
at WebSocket.i.onmessage (https://localhost:44349/_framework/blazor.server.js:1:39007)
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Syncfusion.Blazor.SfBaseComponent.InvokeMethod(String methodName, Object[] methodParams)
at Syncfusion.Blazor.Grids.Internal.FocusHandler`1.Focus(String rowUid, String cellUid, String action)
at Syncfusion.Blazor.Grids.Internal.FocusHandler`1.Refresh(Row`1 Row, Cell`1 Cell)
at Syncfusion.Blazor.Grids.Internal.GridCell`1.<BuildRenderTree>b__0_0(MouseEventArgs e)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'oW203vxsxOd9IqDd4vPESlf42ctt9E_WJvQCf_WkvfA'.
Microsoft.JSInterop.JSException: Cannot read property 'querySelector' of null
TypeError: Cannot read property 'querySelector' of null
at Object.focus (https://localhost:44349/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:118297)
at https://localhost:44349/_framework/blazor.server.js:8:31619
at new Promise (<anonymous>)
at e.beginInvokeJSFromDotNet (https://localhost:44349/_framework/blazor.server.js:8:31587)
at https://localhost:44349/_framework/blazor.server.js:1:20052
at Array.forEach (<anonymous>)
at e.invokeClientMethod (https://localhost:44349/_framework/blazor.server.js:1:20022)
at e.processIncomingData (https://localhost:44349/_framework/blazor.server.js:1:18006)
at e.connection.onreceive (https://localhost:44349/_framework/blazor.server.js:1:11091)
at WebSocket.i.onmessage (https://localhost:44349/_framework/blazor.server.js:1:39007)
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Syncfusion.Blazor.SfBaseComponent.InvokeMethod(String methodName, Object[] methodParams)
at Syncfusion.Blazor.Grids.Internal.FocusHandler`1.Focus(String rowUid, String cellUid, String action)
at Syncfusion.Blazor.Grids.Internal.FocusHandler`1.Refresh(Row`1 Row, Cell`1 Cell)
at Syncfusion.Blazor.Grids.Internal.GridCell`1.<BuildRenderTree>b__0_0(MouseEventArgs e)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
I've tested navigating to the page directly in the address bar, where I then don't get the error, which means that somehow the grid isn't being disposed of properly, or something weird. Any thoughts on what might be the issue?