OnChange and OnBlur event for editors (TelerikTextBox, NumericTextBox, and others) is not fired in InCell edit mode with Tab key.
We are experiencing the same problem in the telerikgrid set to InCell-editmode.
When using 'Tab' to navigate between cells the OnChange event does not fire.
Our current work around is to intercept the keydown-event and execute identical to the one linked to the OnChange-event handler in the (Numeric)Textbox in the cell.
Example :
<EditorTemplate>
<div @onkeydown="@(async (k) => await KeyDownHandlerAsync(k)">
<TelerikNumericTextBox T="int?"
Decimals="0"
Arrows="false"
Max="@HelpersDisplayFormats.IntFieldMaxNrOfDecimals(formats.Digits)"
ValueChanged="@(async (int? value) => await ValueChangedHandlerAsync(value))"
OnChange="@(async (value) => await DoOnChangedHandlerAsync(value))" />
</div>
</EditorTemplate>
// KeyDownHandler :
private async Task KeyDownHandlerAsync(KeyboardEventArgs e)
{
System.Diagnostics.Debug.WriteLine($"Key DOWN: {e.Key}");
if (e.Code == "Tab")
{
// tab intercept! call 'OnChange' event handler here
}
}
onkeydown event fires first from js, key code enter or tab will trigger the moving of the edit to next cell (and closing existing edit will call dispose of original edit template), so at onblur event of existing edit control, the control from blazor side should be disposed already. I don't think OnBlur should be handled in key navigation sequence.
but yes to OnChange should fire before closing existing control.
thanks
wei