[frontend/components] Use onkeyup instead of onkeydown
This commit is contained in:
parent
37ec177e69
commit
372dd95fb8
4 changed files with 8 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
||||||
@inject IJSRuntime Js;
|
@inject IJSRuntime Js;
|
||||||
@inject IStringLocalizer<Localization> Loc;
|
@inject IStringLocalizer<Localization> Loc;
|
||||||
|
|
||||||
<dialog @onkeydown="HandleKeyDown" class="dialog" @ref="Dialog">
|
<dialog @onkeyup="HandleKeys" class="dialog" @ref="Dialog">
|
||||||
<div class="confirm @(Waiting ? "waiting" : "")">
|
<div class="confirm @(Waiting ? "waiting" : "")">
|
||||||
@if (Waiting)
|
@if (Waiting)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
await CloseDialog();
|
await CloseDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
private async Task HandleKeys(KeyboardEventArgs e)
|
||||||
{
|
{
|
||||||
if (e is { Code: "Enter" })
|
if (e is { Code: "Enter" })
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@inject IJSRuntime Js;
|
@inject IJSRuntime Js;
|
||||||
@inject IStringLocalizer<Localization> Loc;
|
@inject IStringLocalizer<Localization> Loc;
|
||||||
|
|
||||||
<dialog @onkeydown="HandleKeyDown" class="dialog" @ref="Dialog">
|
<dialog @onkeyup="HandleKeys" class="dialog" @ref="Dialog">
|
||||||
<div class="notice">
|
<div class="notice">
|
||||||
<span class="notice-icon">
|
<span class="notice-icon">
|
||||||
@switch (Type)
|
@switch (Type)
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
await _module.InvokeVoidAsync("openDialog", Dialog);
|
await _module.InvokeVoidAsync("openDialog", Dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
private async Task HandleKeys(KeyboardEventArgs e)
|
||||||
{
|
{
|
||||||
if (e is { Code: "Enter" or "Escape" })
|
if (e is { Code: "Enter" or "Escape" })
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@inject IJSRuntime Js;
|
@inject IJSRuntime Js;
|
||||||
@inject IStringLocalizer<Localization> Loc;
|
@inject IStringLocalizer<Localization> Loc;
|
||||||
|
|
||||||
<dialog @onkeydown="HandleKeyDown" class="dialog" @ref="Dialog">
|
<dialog @onkeyup="HandleKeys" class="dialog" @ref="Dialog">
|
||||||
<div class="prompt @(Waiting ? "waiting" : "")">
|
<div class="prompt @(Waiting ? "waiting" : "")">
|
||||||
@if (Waiting)
|
@if (Waiting)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
await CloseDialog();
|
await CloseDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
private async Task HandleKeys(KeyboardEventArgs e)
|
||||||
{
|
{
|
||||||
if (MultiLine && e is { Code: "Enter", CtrlKey: true } or { Code: "Enter", MetaKey: true } || !MultiLine && e is { Code: "Enter" })
|
if (MultiLine && e is { Code: "Enter", CtrlKey: true } or { Code: "Enter", MetaKey: true } || !MultiLine && e is { Code: "Enter" })
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
@inject IJSRuntime Js;
|
@inject IJSRuntime Js;
|
||||||
@inject IStringLocalizer<Localization> Loc;
|
@inject IStringLocalizer<Localization> Loc;
|
||||||
|
|
||||||
<dialog @onkeydown="HandleKeyDown" class="dialog" @ref="Dialog">
|
<dialog @onkeyup="HandleKeys" class="dialog" @ref="Dialog">
|
||||||
<div class="select @(Waiting ? "waiting" : "")">
|
<div class="select @(Waiting ? "waiting" : "")">
|
||||||
@if (Waiting)
|
@if (Waiting)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
await CloseDialog();
|
await CloseDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleKeyDown(KeyboardEventArgs e)
|
private async Task HandleKeys(KeyboardEventArgs e)
|
||||||
{
|
{
|
||||||
if (e is { Code: "Enter" })
|
if (e is { Code: "Enter" })
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue