When using StateHasChanged, the value is not reflected in the InputText
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
In the InputText component, when using StateHasChanged, the value change is not reflected in the UI of the InputText component.
```
InputText:
Current InputText: @InputText
@code {
public string InputText { get; set; } = "abc";
protected void HandleValueChanged(string? args)
{
if (args != "test")
{
InputText = args;
}
else
{
StateHasChanged();
}
}
}
```
### Expected Behavior
Expected Output: When using StateHasChanged, the value needs to be reflected in the input of the InputText also.
Current Output: When using StateHasChanged, the value is not reflected in the input of the InputText .
### Steps To Reproduce
1. Run the Sample.
2. Type “Example” and focus out.
3. Now, The Values are updated properly in Both UI and ValueChanged event args.
4. Type “test” and focus out.
### Exceptions (if any)
_No response_
### .NET Version
net7.0
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.