I can't figure out why if I assign an empty string in the "if" block, everything works and the string and field are updated.But if I remove the space at the end, also changing the variable, nothing happens. I used StateHasChanged but it does not help. I checked the value through debugging, the line definitely changes.
<TagList ListOfTagNames="Tags"><InputText @bind-value="Tag" @oninput="HandleInput" class="w-full inputSetUp bgDarkLight" placeholder="Укажитетеги..." /><p>Value: @Tag</p></TagList>@code { public string Tag { get; set; } = ""; [Parameter] public List<string> Tags { get; set; } = new(); private void HandleInput(ChangeEventArgs e) { Tag = e.Value.ToString().TrimStart(); bool spaceIsTiped = Tag.EndsWith(''); bool isValidTag = !string.IsNullOrEmpty(Tag) && Tag.Length > 2 && spaceIsTiped; if (isValidTag) { Tags.Add(Tag.ToUpper()); Tag = ""; } else { Tag = Tag.Trim(); StateHasChanged(); } }}