Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor not updating same value in input twice after manually manipulated same value though its firing change event

$
0
0

Following is simple code

 @page "/demo"<h3>POCBlazor</h3>Input 1 :<input type="text" value="@somedata" @onchange="changeValue" placeholder="text 1" />Input 2 :<input type="text" placeholder="text 2" />@code {    public string somedata { get; set; }    void changeValue(ChangeEventArgs eventArgs)    {        somedata = eventArgs.Value.ToString();        somedata = somedata +"asdf";        StateHasChanged();    }}

Scenario
1) I add new value in input 1 then it represent with "asdf"
e.g: enter value "123" -- changeValue function called --> Input 1 = "123asdf"

2) Second time I update input 1 with same value then the change event fired and code works but value is not updating in input 1
second time: again enter value "123" --- changeValue function called --> Input 1 = "123"


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>