JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Text Boxes & Inputs › Blazor Input OnChange Event Handling › Reply To: Blazor Input OnChange Event Handling
Hello,
I’m having the same issue with the OnChange handling, but on <TimeInput> component.
Ivan Peevski response works fine with the <Input>, but if you try the same approach with the <TimeInput> as
<TimeInput @bind-Value=”@textValue” OnChange=”changeEvent”></TimeInput>, the textValue never changes.
Here is my code sample:
<h3>@textValue</h3>
<TimeInput @bind-Value=”@textValue” OnChange=”changeEvent”></TimeInput>@code{
IEnumerable<string>textValue = new List<string>{“13″,”00”};
private void changeEvent(Event ev)
{
Console.WriteLine(textValue);}
}
Note that the initial setting of the textValue sets the TimeInput to the 01:00 pm, but changing time in the component doesn’t change the textValue field.
Another observation. If the field textValue type is a simple string as string textValue = “”;, it’s always empty no matter what time you select in the component.
I couldn’t find any clues in the API Docs (it would be really nice to have some basic examples there). If you would provide any explanations on TimeInput specifics???
Thank you,
- This reply was modified 1 week, 2 days ago by Victor Sirghii.