Auto focus on login text box
This commit is contained in:
@ -10,7 +10,7 @@
|
|||||||
<RadzenText TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">Вход</RadzenText>
|
<RadzenText TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">Вход</RadzenText>
|
||||||
<RadzenFormField Text="Логин" Variant="Variant.Outlined">
|
<RadzenFormField Text="Логин" Variant="Variant.Outlined">
|
||||||
<ChildContent>
|
<ChildContent>
|
||||||
<RadzenTextBox Name="UserName" @bind-Value=@Input.UserName AutoCompleteType="AutoCompleteType.Username" />
|
<RadzenTextBox @ref="@userNameTextBox" Name="UserName" @bind-Value=@Input.UserName AutoCompleteType="AutoCompleteType.Username" />
|
||||||
</ChildContent>
|
</ChildContent>
|
||||||
<Helper>
|
<Helper>
|
||||||
<RadzenRequiredValidator Component="UserName" Text="Поле 'Логин' обязательно к заполнению" />
|
<RadzenRequiredValidator Component="UserName" Text="Поле 'Логин' обязательно к заполнению" />
|
||||||
@ -41,6 +41,8 @@
|
|||||||
public string Password { get; set; } = "";
|
public string Password { get; set; } = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RadzenTextBox userNameTextBox;
|
||||||
|
|
||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
InputModel Input { get; set; } = new();
|
InputModel Input { get; set; } = new();
|
||||||
|
|
||||||
@ -52,8 +54,6 @@
|
|||||||
|
|
||||||
protected override void OnAfterRender(bool firstRender)
|
protected override void OnAfterRender(bool firstRender)
|
||||||
{
|
{
|
||||||
base.OnAfterRender(firstRender);
|
|
||||||
|
|
||||||
if (firstRender)
|
if (firstRender)
|
||||||
{
|
{
|
||||||
if (Status == "failed")
|
if (Status == "failed")
|
||||||
@ -66,6 +66,8 @@
|
|||||||
Duration = -1d
|
Duration = -1d
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userNameTextBox.Element.FocusAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user