skclusive / Skclusive.Material.Component

Port of Material-UI in C# for Blazor
https://skclusive.github.io/Skclusive.Blazor.Samples/Dashboard
MIT License
397 stars 54 forks source link

Link component in WebAssembly #54

Closed viniwrubleski closed 4 years ago

viniwrubleski commented 4 years ago

When using the Link component in Blazor WebAsembly I get the following error when I click the Link:

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Unknown edit type: 0 Error: Unknown edit type: 0 at e.applyEdits (https://localhost:44391/_framework/blazor.webassembly.js:1:15008) at e.updateComponent (https://localhost:44391/_framework/blazor.webassembly.js:1:12880) at Object.t.renderBatch (https://localhost:44391/_framework/blazor.webassembly.js:1:1704) at Object.window.Blazor._internal.renderBatch (https://localhost:44391/_framework/blazor.webassembly.js:1:34784) at _mono_wasm_invoke_js_unmarshalled (https://localhost:44391/_framework/wasm/dotnet.3.2.0.js:1:172099) at wasm_invoke_iiiiii (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[3160]:0x9b33d) at icall_trampoline_dispatch (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[5777]:0xfe711) at mono_wasm_interp_to_native_trampoline (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[4607]:0xca81d) at ves_pinvoke_method (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[3209]:0x9cd40) at interp_exec_method (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[1120]:0x2598d) Microsoft.JSInterop.JSException: Unknown edit type: 0 Error: Unknown edit type: 0 at e.applyEdits (https://localhost:44391/_framework/blazor.webassembly.js:1:15008) at e.updateComponent (https://localhost:44391/_framework/blazor.webassembly.js:1:12880) at Object.t.renderBatch (https://localhost:44391/_framework/blazor.webassembly.js:1:1704) at Object.window.Blazor._internal.renderBatch (https://localhost:44391/_framework/blazor.webassembly.js:1:34784) at _mono_wasm_invoke_js_unmarshalled (https://localhost:44391/_framework/wasm/dotnet.3.2.0.js:1:172099) at wasm_invoke_iiiiii (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[3160]:0x9b33d) at icall_trampoline_dispatch (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[5777]:0xfe711) at mono_wasm_interp_to_native_trampoline (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[4607]:0xca81d) at ves_pinvoke_method (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[3209]:0x9cd40) at interp_exec_method (https://localhost:44391/_framework/wasm/dotnet.wasm:wasm-function[1120]:0x2598d) at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,T2,TResult] (System.String identifier, T0 arg0, T1 arg1, T2 arg2) <0x30a7ff8 + 0x00046> in <filename unknown>:0 at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,TResult] (System.String identifier, T0 arg0, T1 arg1) <0x30a7f18 + 0x00014> in <filename unknown>:0 at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync (Microsoft.AspNetCore.Components.RenderTree.RenderBatch& batch) <0x30a7e20 + 0x0001e> in <filename unknown>:0 at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue () <0x2cf55a8 + 0x000f2> in <filename unknown>:0

In Blazor Server the problem does not occur.

I found some issues in the dotnet github (17926 and 21241) that suggests it is some kind of problem with the blur event.

Removing the blur event in the component seems to fix the problem. Can I make a pull request removing the event or you intend to use it? Currently it just add a CSS class to it, but I don't think it is necessary as we can just use the :focus selector.

skclusive commented 4 years ago

great. please go ahead and create the PR.

skclusive commented 4 years ago

closing the issue as the PR merged