How to make an EditForm Input that binds using oninput rather than onchange

后端 未结 4 2099
名媛妹妹
名媛妹妹 2020-12-19 20:58

Suppose I want to use an EditForm, but I want the value binding to trigger every time the user types into the control instead of just on blur. Suppose, for the sake of an ex

4条回答
  •  春和景丽
    2020-12-19 21:05

    For anyone wondering, you can subclass InputText to change how it renders. For example, to make it use the oninput event, create MyInputText.razor containing:

    @inherits Microsoft.AspNetCore.Components.Forms.InputText
    
    

    Now when you use it will behave just like InputText except it updates on each keystroke.

    SteveSanderson

提交回复
热议问题