-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datagrid_page F5 to refresh error:JS object instance with ID 2 does not exist (has it been disposed?) #1036
Comments
Sorry, but this contains absolutely nothing that we can reproduce or respond to. Closing this |
@vnbaaij I have the same issue and have a sample solution to reproduce this. I have more details: 🐛 Bug ReportI have a page with a FluentDataGrid and a reload button. This runs fine on web but when I hit the reload button while running on Android in a Maui hybrid app I get this error: Error: JS object instance with ID 3 does not exist (has it been disposed?). 💻 Repro or Code Sample🤔 Expected BehaviorI would expect I can reload the page running on Android without errors, just like in web 😯 Current BehaviorWhen I run the sample application in Maui on a android simulator and hit the reload button I get this error: chromium] [INFO:CONSOLE(1)] "JS object instance with ID 3 does not exist (has it been disposed?). 💁 Possible SolutionDo not use the FluentDataGrid 🔦 ContextThe user can change the language (localization) and therefore the page needs to be reloaded. I would like the possiblity to change language on every page, also the ones with the a FluentDataGrid. 🌍 Your EnvironmentOS: Windows 11 |
Yes, FluentDataGrid is a QuickGrid in disguise. I'm reopening the issue (as blocked) so we can keep an eye on this MAUI issue you linked to. |
Unfortunately, I also have a similar multi-language solution, but I found that any component with a KeyCode (such as NavMenu) will trigger a similar error in Blazor WPF during reload. |
14-36-40.mp4 |
@chungou1996 as mentioned, it is an (open) issue on the MAUI side. Nothing we can do here until that is fixed, |
thanks, here's the temporary solution: before reload, notify the layout to hide all component (using conditional rendering) and handle it in OnAfterRenderAsync: if (_reloading)
{
var culture = await CultureJSInterop.GetCultureAsync() ?? CultureInfo.CurrentCulture;
// something else
NavigationManager.Refresh(forceReload: true);
} |
this will be solved once a fix is deployed on the MAUI side. Closing this here as we can't do anything on our side, |
The same happens with WebView2 on WPF. The workaround suggested by @chungou1996 also works for WPF. We have handled a reload by listening for the ‘NavigationStarting’ event of WebView2 and making sure that all elements are hidden before the actual reload takes place. // MainWindow.xaml.cs
private void WebView2_NavigationStarting(object? sender, CoreWebView2NavigationStartingEventArgs e)
{
_ReloadService.SetReloading(true);
} @* App.razor *@
@if (!_IsReloading)
{
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
} |
platform:net8.0
library:Blazor Hybrid
nuget:Microsoft.AspNetCore.Components.WebView 8.0
error info:
The text was updated successfully, but these errors were encountered: