SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 386 forks source link

MatAutocompleteList bug on tab enter #609

Open VL-Rukas opened 4 years ago

VL-Rukas commented 4 years ago

MatAutocompleteList control rises error and breaks connection on tab enter when switching throught component controls using "Tab". MatBlazor v2.6.0, serverside, NET.Core v3.1.5. Error: Microsoft.JSInterop.JSException: Cannot read property '$list' of null TypeError: Cannot read property '$list' of null at Object.e.setSelectedIndex (https://localhost:44333/_content/MatBlazor/dist/matBlazor.js:1:241059) at https://localhost:44333/_framework/blazor.server.js:8:31421 at new Promise () at e.beginInvokeJSFromDotNet (https://localhost:44333/_framework/blazor.server.js:8:31390) at https://localhost:44333/_framework/blazor.server.js:1:19202 at Array.forEach () at e.invokeClientMethod (https://localhost:44333/_framework/blazor.server.js:1:19173) at e.processIncomingData (https://localhost:44333/_framework/blazor.server.js:1:17165) at e.connection.onreceive (https://localhost:44333/_framework/blazor.server.js:1:10276) at WebSocket.i.onmessage (https://localhost:44333/_framework/blazor.server.js:1:38091) at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args) at MatBlazor.BaseMatComponent.JsInvokeAsync[T](String code, Object[] args) at MatBlazor.BaseMatList.SetSelectedIndex(Int32 index) at MatBlazor.BaseMatAutocompleteList1.OnKeyDown(KeyboardEventArgs ev) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state) at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource1 completion, SendOrPostCallback d, Object state) at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

sebestyn168 commented 4 years ago

I just saw your issue and I think I opened a duplicate. You can check the suggested solution on #614