Skip to content

MudCodeInput - MudInput.FocusAsync: ElementReference has not been configured correctly. #611

@MarkHorton56

Description

@MarkHorton56

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);

<MudCodeInput Class="login"
                              InputType="InputType.Number"
                              T="string"
                              @bind-Value="@_inputCode"
                              Count="6"
                              Spacing="2"
                              Variant="Variant.Outlined"
                              Margin="Margin.None"
                              Required="true"/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions