I am trying to get the oninput event to work when the ENTER key is pressed. However, I am running into an exception prior to pressing the ENTER key.
To reproduce:
- Place the focus in the RadzenDatePicker control (at the end of line).
- Press the backspace key.
- An exception is thrown (see attached image)
My control is defined like:
<RadzenDatePicker @bind-Value="StartDate" @onkeypress="@Enter" @bind-Value:event="oninput" DateFormat="d"></RadzenDatePicker>
`
@code {
private Datetime StartDate;
public async Task Enter(KeyboardEventArgs e)
{
if (e.Code == "Enter" || e.Code == "NumpadEnter")
{
await FilterApply();
}
}
}
`
For a comparison, this code works as expected:
<input type="date" class="form-control" @bind-value="@StartDate" @bind-value:event="oninput" @onkeypress="@Enter" />
Thoughts on how I can get the oninput event to work with DatePicker control?
Thanks.