I have:
<input onkeypress="@Foo" />
and:
@functions
{
void Foo(UIKeyboardEventArgs e)
{
}
}
How do I pass, or otherwise retrieve, the value of the input in the handler method?
Unfortunately, you need oninput event to update the bound variable.
@value
<input type="text" @bind="@value" @oninput="@(ui => { value = (string) ui.Value);})" />
@functions {
string value;
}