Пример #1
0
        protected virtual async Task OnInputHandler(ChangeEventArgs e)
        {
            if (Options.ChangeTextOnKeyPress)
            {
                var caret = await JSRunner.GetCaret(ElementRef);

                await CurrentValueHandler(e?.Value?.ToString());

                await JSRunner.SetCaret(ElementRef, caret);
            }
        }
Пример #2
0
        /// <summary>
        /// Handler for @oninput event.
        /// </summary>
        /// <param name="eventArgs">Information about the changed event.</param>
        /// <returns>Returns awaitable task</returns>
        protected virtual async Task OnInputHandler(ChangeEventArgs eventArgs)
        {
            if (IsChangeTextOnKeyPress)
            {
                if (IsDelayTextOnKeyPress)
                {
                    inputValueDebouncer?.Update(eventArgs?.Value?.ToString());
                }
                else
                {
                    var caret = await JSRunner.GetCaret(ElementRef);

                    await CurrentValueHandler(eventArgs?.Value?.ToString());

                    await JSRunner.SetCaret(ElementRef, caret);
                }
            }
        }