Blazor WebAssembly - "Cannot read property 'parentNode' of undefined TypeError: Cannot read property 'parentNode' of undefined" when a focused element is hidden #33997
Labels
area-blazor
Includes: Blazor, Razor Components
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
Milestone
Describe the bug
Unfortunately, I cannot reopen the 26838 issue so I'm creating a new one.
In the latest .NET 6 preview version an exception occurs if an element has the onfocusout event handled, and the click is handled in the asynchronous way.
To Reproduce
Run a project with the code below and click the button:
Exceptions (if any)
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Cannot read property 'parentNode' of undefined TypeError: Cannot read property 'parentNode' of undefined at O (https://localhost:44354/_framework/blazor.webassembly.js:1:13297) at V.applyEdits (https://localhost:44354/_framework/blazor.webassembly.js:1:17125) at V.updateComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:16469) at https://localhost:44354/_framework/blazor.webassembly.js:1:49688 at Object.he._internal.renderBatch (https://localhost:44354/_framework/blazor.webassembly.js:1:50058) at Object.ct [as invokeJSFromDotNet] (https://localhost:44354/_framework/blazor.webassembly.js:1:52281) at _mono_wasm_invoke_js_blazor (https://localhost:44354/_framework/dotnet.6.0.0-preview.4.21253.7.js:1:211543) at <anonymous>:wasm-function[5707]:0xdfd2f at <anonymous>:wasm-function[5802]:0xe1d70 at <anonymous>:wasm-function[2185]:0x459a5 Microsoft.JSInterop.JSException: Cannot read property 'parentNode' of undefined TypeError: Cannot read property 'parentNode' of undefined at O (https://localhost:44354/_framework/blazor.webassembly.js:1:13297) at V.applyEdits (https://localhost:44354/_framework/blazor.webassembly.js:1:17125) at V.updateComponent (https://localhost:44354/_framework/blazor.webassembly.js:1:16469) at https://localhost:44354/_framework/blazor.webassembly.js:1:49688 at Object.he._internal.renderBatch (https://localhost:44354/_framework/blazor.webassembly.js:1:50058) at Object.ct [as invokeJSFromDotNet] (https://localhost:44354/_framework/blazor.webassembly.js:1:52281) at _mono_wasm_invoke_js_blazor (https://localhost:44354/_framework/dotnet.6.0.0-preview.4.21253.7.js:1:211543) at <anonymous>:wasm-function[5707]:0xdfd2f at <anonymous>:wasm-function[5802]:0xe1d70 at <anonymous>:wasm-function[2185]:0x459a5 at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object,Object](String identifier, Int32 arg0, RenderBatch arg1, Object arg2, Int64 targetInstanceId) at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[Int32,RenderBatch,Object](String identifier, Int32 arg0, RenderBatch arg1) at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync(RenderBatch& batch) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Further technical details
The text was updated successfully, but these errors were encountered: