Browse Source

allow enter key to submit add to collection dialog (#167)

pull/168/head
Jason Dove 5 years ago committed by GitHub
parent
commit
a854294cb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      ErsatzTV/Shared/AddToCollectionDialog.razor

11
ErsatzTV/Shared/AddToCollectionDialog.razor

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
@inject ISnackbar Snackbar
@inject ILogger<AddToCollectionDialog> Logger
<div @onkeydown="@OnKeyDown">
<MudDialog>
<DialogContent>
<MudContainer Class="mb-6">
@ -35,6 +36,8 @@ @@ -35,6 +36,8 @@
</MudButton>
</DialogActions>
</MudDialog>
</div>
@code {
@ -109,4 +112,12 @@ @@ -109,4 +112,12 @@
private void Cancel() => MudDialog.Cancel();
private async Task OnKeyDown(KeyboardEventArgs e)
{
if (e.Code is "Enter" or "NumpadEnter" && CanSubmit())
{
await Submit();
}
}
}
Loading…
Cancel
Save