We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Multiline does not fire onchange native event.

In the below code, the @onchange is not fired for a TextBox with the Multiline property set.

--

@page "/TextBoxMultiline"
@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Inputs

<div>
    <dl class="row">
        <dt class="col-sm-3 control-label">First Name</dt>
        <dd class="col-sm-9">
            <EjsTextBox Value="@Singleline"
                        @onchange="@((Microsoft.AspNetCore.Components.ChangeEventArgs args) => { Singleline = (string)args.Value; StateHasChanged(); } )">
            </EjsTextBox>
            <EjsTextBox Value="@Multiline"
                        Multiline="true"
                        @onchange="@((Microsoft.AspNetCore.Components.ChangeEventArgs args) => { Multiline = (string)args.Value; StateHasChanged(); } )">
            </EjsTextBox>
        </dd>
    </dl>
    <hr />
    <div>
        <h5>Values</h5>
        Single: @Singleline<br />
        Multi: @Multiline<br />
    </div>
</div>

@code {
    [Parameter()]
    public string Singleline { get; set; } = "";

    [Parameter()]
    public string Multiline { get; set; } = "";

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        Singleline = "This is a single line value.";
        Multiline = "This is a multiline value.\rThis is a second line.";
    }
}


1 Reply

SP Sureshkumar P Syncfusion Team October 7, 2019 11:15 AM UTC

Hi Michael, 

Greetings from Syncfusion support, 

We have validated your reported issue and this is known issue in our end. We have logged bug report for it and this fix will be available on mid of October 2019. You can track the status of this bug in the below feedback link.   
  

To meet your requirements, we suggest using our inbuild ValueChange event to access the multi-line textbox component change event features. The code block and sample can be found here. 

[index.razor] 

<EjsTextBox Value="@Multiline" 
                        Multiline="true" 
                        ValueChange="@multiLineChange"> 
            </EjsTextBox> 
@code { 
 
    [Parameter()] 
    public string Multiline { get; set; } = ""; 
 
    protected override async Task OnInitializedAsync() 
    { 
        await base.OnInitializedAsync(); 
        Multiline = "This is a multiline value.\rThis is a second line."; 
    } 
 
    void multiLineChange(Syncfusion.EJ2.Blazor.Inputs.ChangedEventArgs args) 
    { 
        this.Multiline = args.Value;  
        StateHasChanged(); 
    } 
} 


Regards, 
Sureshkumar P 


Loader.
Live Chat Icon For mobile
Up arrow icon