Skip to content

Poor typing experience in Blazor Server app when manually binding to oninput event and using Azure SignalR Services #14242

@danroth27

Description

@danroth27

Repro steps:

  • Create a new Blazor Server app
  • Add the following code in index.razor:
@page "/"

<h1>Hello, world!</h1>

Welcome to your new app.

<input value="@message" @oninput="OnInput" />

<p>@message</p>

@code {
    string message;

    void OnInput(ChangeEventArgs e) {
        message = (string)e.Value;
    }
}
  • Run it and try mashing on the board when typing in the textbox. Works fine.

QyriWYUtKx

  • Publish to Azure App Service with the Azure SignalR Service
  • Browse to the published app and mash on the keyboard again. Poor typing experience.

hVsGL8FSxM

  • Publish to Azure App Service without the Azure SignalR Service, but with WebSockets enabled. Works fine.

ZLudipvtBQ

  • Switching the code to use @bind works around the issue.
@page "/"

<h1>Hello, world!</h1>

Welcome to your new app.

<input @bind="message" @bind:event="oninput" />

<p>@message</p>

@code {
    string message;

    void OnInput(ChangeEventArgs e) {
        message = (string)e.Value;
    }

}

ncW8ogiXKA

But in my case I need access to the oninput event callback to run additional logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions