-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
no dispatchGlobalEventToAllElements when no renderer attached #58667
base: release/8.0
Are you sure you want to change the base?
no dispatchGlobalEventToAllElements when no renderer attached #58667
Conversation
Thanks for your PR, @zuizuihao. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Hi @zuizuihao. If this is not a tell-mode PR, please make sure to follow the instructions laid out in the servicing process document. |
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
/azp run |
Commenter does not have sufficient privileges for PR 58667 in repo dotnet/aspnetcore |
any progress on it @javiercn |
ROOT CAUSE
when Blazor connection closed, the detachWebRendererInterop in the callback of connection.onclose will be invoked. here, it will invoke interopMethodsByRenderer.delete(rendererId);, all the interopMethodsByRenderer will be cleaned. also There are lots of global event listener in form.js like window.addEventListener('focus'), window.addEventListener('keydown'). if user still interact with our app like focus, click, the global event will be triggered, then invoked EventDelegator.onGlobalEvent, invoked EventDelegator.dispatchGlobalEventToAllElements invoked WebRendererInteropMethods.dispatchEvent invoked WebRendererInteropMethods.getInteropMethods, here since the interopMethodsByRenderer is empty, will throw this exception.
SOLUTION:
check isRendererAttached before dispatchGlobalEventToAllElements in EventDelegator
Fixes #57828
Before Fixes:
After Fixes: