Skip to content

EditForm: oninput loses typed characters during rapid typing / long key press on slow network #65994

Todo

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

We are observing an issue in Blazor EditForm where oninput does not consistently receive all typed characters when using either:

InputText
Native HTML input

This problem becomes clearly reproducible during rapid typing scenarios, especially when long‑pressing a key (e.g., holding down the "g" key) on a Slow 3G–throttled hosted application.
Because of this behavior, we are unable to capture the actual typed value reliably while the user is typing.

`@using System.ComponentModel.DataAnnotations

<div class="form-group">
    <input value="@userModel.Phone"
           @oninput="e => userModel.Phone = e.Value?.ToString()" />
</div>

<div>
    Email: @userModel.Email <br />
    Phone: @userModel.Phone
</div>

@code {
private UserModel userModel = new();

private void OnEmailChanged(string newValue)
{
    userModel.Email = newValue;
}

public class UserModel
{
    [Required]
    public string Email { get; set; }

    [Required]
    public string Phone { get; set; }
}

}`

Expected Behavior

Expected behavior

  • oninput should receive all typed characters
  • Model value should reflect the exact user input
  • Network latency should not cause character loss

Actual behavior

  • Characters are dropped or delayed
  • oninput does not reflect the complete typed value
  • Model becomes temporarily inconsistent
  • Validation and dependent logic behave incorrectly

Steps To Reproduce

Steps to reproduce

  • Deploy the app to a hosted environment
  • Open browser DevTools → Network tab
  • Throttle the network to Slow 3G
  • Focus on the input field
  • Long‑press any key (e.g., hold "g")
  • Observe the bound values displayed below

Exceptions (if any)

We evaluated debouncing as a potential approach, but it does not solve the issue because:

The oninput event itself does not contain all typed characters
Debounce only delays processing; it cannot recover missing input
Our requirement depends on accurate typed values while typing

Therefore, debounce is not a viable solution for this scenario.

This blocks scenarios that require:

  • Real‑time typed input processing
  • Character‑level validation or detection
  • Reliable input handling under slow or unstable networks

Could you please help clarify:

  • Is this behavior expected under slow network conditions?
  • Is there a recommended Blazor pattern to reliably capture all typed values during oninput?
  • Could this be a regression or known limitation in EditForm / InputText?
  • Are there any supported alternatives to handle this scenario without losing characters?

Related issues

#14242
#8204

Although these issues are closed, the behavior still appears reproducible in the scenario described above.

.NET Version

10

Anything else?

No response

Activity

  1. janslavsky commented on Apr 3, 2026

    @janslavsky

    Facing the same problem in Syncfusion components. If there are many component on page hadling the same event Blazor framework is useless.

  2. added
    needs-area-label
    on Jun 7, 2026
  3. added
    area-blazor
    and removed
    needs-area-label
    on Sep 2, 2026
  4. added theissue type on Sep 2, 2026
  5. added this to the Backlog milestone on Sep 2, 2026
  6. BhaskarSuresh22 commented on Sep 24, 2026

    @BhaskarSuresh22

    I tested this scenario with Interactive Server on .NET 10 and .NET 11 using Microsoft Edge with 3G network throttling.

    I couldn't reproduce permanent character loss in either version. Rapid typing and long key presses produced the correct final input and model values. I did observe a slight delay before the Razor-rendered model value updated. This is expected because an Interactive Server event and its resulting render must complete a browser-server-browser round trip.

    The original sample manually combines value with @oninput:

    <input value="@userModel.Phone"
           @oninput="e => userModel.Phone = e.Value?.ToString()" />

    The InputText example also combines its normal onchange binding with a separate @oninput handler. As a sample-level workaround, I replaced these independent update paths with Blazor's supported oninput binding:

    <input @bind="userModel.Phone"
           @bind:event="oninput" />

    When custom assignment and per-keystroke EditForm validation are required, I used @bind:get/@bind:set and notified the EditContext:

    <input @bind:event="oninput"
           @bind:get="userModel.Email"
           @bind:set="SetEmail" />
    private void SetEmail(string? value)
    {
        userModel.Email = value;
        editContext.NotifyFieldChanged(emailField);
    }

    This allows Blazor to associate the oninput event with the element's value while retaining field validation. Each event supplies the complete input value at that point rather than an individual character delta.

    For additional processing after assignment, @bind:after can also be used:

    <input @bind="userModel.Email"
           @bind:event="oninput"
           @bind:after="OnEmailChanged" />

    Video:

    EditFormLag.mp4

    Sample:

  7. added
    bug
    on Oct 23, 2026
  8. self-assigned this
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-blazorbug

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions