Performance issue while using oninput event in version 18.3.0.38
Hi, I am using oninput event in SfTextBox but when I type a character it get's displayed after a brief delay. If I remove oninput event it works perfectly!
Here is my code:
<SfTextBox ShowClearButton = "true" Value = "@InputValue" @oninput = "@(() => {Console.WriteLine("Yes");})" ></SfTextBox>
The same happens if I use the Input property
<SfTextBox ShowClearButton = "true" Value = "@InputValue" Input = "@OnInput"></SfTextBox>
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
SN
Sevvandhi Nagulan
Syncfusion Team
October 13, 2020 09:20 AM UTC
Hi Tom,
Greetings from Syncfusion support.
We have checked your query. We made sample with the provided code snippet and we cannot reproduce the mentioned issue in the latest version of 18.3.0.38. Here we have attached the ensured sample and video demonstration of the issue. Kindly check with the attached sample and provide a video demonstration of the issue that will help us to further validate the issue and provide you with a better solution from our end.
Server side sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Performance_issue839386477
Client side sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Performance_issue1859308044
Regards,
Sevvandhi N
TD
Tom Dimos
October 13, 2020 10:27 AM UTC
Sry for wasting your time with wrong info but I didn't rly tried to reproduce it from my side to further understand the issue and I thought this has to do with the SfTextBox but instead it occurs if you place the SfTextBox inside a FilterTemplate in a DataGrid. I managed to reproduce the issue using the code below and especially it happens if you use a "big" PageSize.
@page "/test"
@using Syncfusion.Blazor.Inputs;
@using Syncfusion.Blazor.Grids
<SfGrid DataSource="@Orders" AllowPaging="true" AllowFiltering = "true">
<GridPageSettings PageSize="50"></GridPageSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150">
<FilterTemplate>
<SfTextBox ShowClearButton = "true" Value = "@InputValue" @oninput="@(() => {Console.WriteLine("Yes");})"></SfTextBox>
</FilterTemplate>
</GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code {
public string InputValue { get; set; }
public List<Order> Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
public class Order {
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
}
@using Syncfusion.Blazor.Inputs;
@using Syncfusion.Blazor.Grids
<SfGrid DataSource="@Orders" AllowPaging="true" AllowFiltering = "true">
<GridPageSettings PageSize="50"></GridPageSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150">
<FilterTemplate>
<SfTextBox ShowClearButton = "true" Value = "@InputValue" @oninput="@(() => {Console.WriteLine("Yes");})"></SfTextBox>
</FilterTemplate>
</GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code {
public string InputValue { get; set; }
public List<Order> Orders { get; set; }
protected override void OnInitialized()
{
Orders = Enumerable.Range(1, 75).Select(x => new Order()
{
OrderID = 1000 + x,
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
Freight = 2.1 * x,
OrderDate = DateTime.Now.AddDays(-x),
}).ToList();
}
public class Order {
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
}
}
RN
Rahul Narayanasamy
Syncfusion Team
October 16, 2020 01:01 PM UTC
Hi Tom,
Thanks for sharing the details.
We have validated your query with the provided details and checked the problem at our end. We can able to notice some delay while typing the values in SfTextBox with oninput event which is rendered in FilterTemplate(.Net 3.1 with Blazor WebAssembly application).
Recently, dotnet team announced .Net 5.0 RC1 update. In this update, dotnet team improved the performance for web assembly. Find the below link for reference.
We have also provided support for .Net 5.0 RC1 update from 18.3.0.35 version(from volume 3 release).
Now, we have checked the reported problem in .Net 5.0 RC1 and Syncfusion NuGet version 18.3.0.41 version. The reported delay was reduced and it will show the entered values without any noticeable delay.
We have prepared a sample in .Net 5.0 RC1 update and Syncfusion NuGet version 18.3.0.41. Find the the below sample for your reference.
Please let us know if you have any concerns.
Regards,
Rahul
Marked as answer
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
TD Tom Dimos
- Oct 12, 2020 12:53 PM UTC
- Oct 16, 2020 01:01 PM UTC