Browse Source

Wrap the role creation form by EditForm to submit the form with Enter key

pull/5575/head
Halil İbrahim Kalkan 6 years ago
parent
commit
d0a1dffc76
  1. 20
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor
  2. 3
      modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor

20
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor

@ -84,18 +84,20 @@
<CloseButton Clicked="CloseCreateModalAsync" />
</ModalHeader>
<ModalBody>
<Field>
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
<TextEdit @bind-text="NewEntity.Name" />
</Field>
<Field>
<Check TValue="bool" @bind-checked="@NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
</Field>
<EditForm id="CreateRoleForm" Model="@NewEntity" OnValidSubmit="CreateEntityAsync">
<Field>
<FieldLabel>@L["DisplayName:RoleName"]</FieldLabel>
<TextEdit @bind-text="@NewEntity.Name"/>
</Field>
<Field>
<Check TValue="bool" @bind-checked="@NewEntity.IsDefault">@L["DisplayName:IsDefault"]</Check>
<Check TValue="bool" @bind-checked="@NewEntity.IsPublic">@L["DisplayName:IsPublic"]</Check>
</Field>
</EditForm>
</ModalBody>
<ModalFooter>
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button>
<Button Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button>
<Button form="CreateRoleForm" Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button>
</ModalFooter>
</ModalContent>
</Modal>

3
modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor

@ -1,5 +1,6 @@
@using Microsoft.AspNetCore.Components.Web
@using Volo.Abp.AspNetCore.Components.WebAssembly
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.BlazoriseUI
@using Blazorise
@using Blazorise.DataGrid
@using Blazorise.DataGrid

Loading…
Cancel
Save