You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MudCodeInput - MudInput.FocusAsync: ElementReference has not been configured correctly. #611
Blazor server side error reported MudInput.FocusAsync: ElementReference has not been configured correctly given the below configuration and all 6 fields completed; pressing tab or moving focus with cursor causes the error to repeat.
The code here needs check the length does not exceed the Count value.
Suggest int focusIndex = Math.Min(Count-1, str.Length);
Hi @mckaragoz, I can reproduce this on dev. When every box is filled, CheckFocus focuses _elementReferences[str.Length], which is one of the placeholder instances created in SyncReferences() and never rendered. MudInputExtended.FocusAsync catches the failure and logs it, so the app doesn't crash, but focus stays on the clicked box and the error is logged on every focus.
I'd like to fix this and add a bUnit test for MudCodeInput (it has none yet). Which behavior would you prefer when all boxes are filled?
Focus the last box, as suggested above.
Don't redirect at all and leave focus on the box that was clicked.
Activity
nurullahturkoglu commentedon Oct 10, 2026
Hi @mckaragoz, I can reproduce this on
dev. When every box is filled,CheckFocusfocuses_elementReferences[str.Length], which is one of the placeholder instances created inSyncReferences()and never rendered.MudInputExtended.FocusAsynccatches the failure and logs it, so the app doesn't crash, but focus stays on the clicked box and the error is logged on every focus.I'd like to fix this and add a bUnit test for
MudCodeInput(it has none yet). Which behavior would you prefer when all boxes are filled?mckaragoz commentedon Oct 10, 2026
This would be better. Thanks for handling the issue.