Skip to content

Instantly share code, notes, and snippets.

@SQL-MisterMagoo
Created April 23, 2020 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SQL-MisterMagoo/6116024caa21f6037864ce2b375c2878 to your computer and use it in GitHub Desktop.
Save SQL-MisterMagoo/6116024caa21f6037864ce2b375c2878 to your computer and use it in GitHub Desktop.
DoubleClickAndBlur
<table class="table-bordered">
<tr>
<td @ondblclick="StartEdit">
@if (Editing)
{
<input @bind="Name" @onblur="EndEdit" />
}
else
{
<span>@(Name ?? "double-click here")</span>
}
</td>
</tr>
</table>
@code
{
string Name;
bool Editing;
void StartEdit() => Editing = true;
void EndEdit() => Editing = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment