I have an application where the user can insert text at a certain location. The text is shown on a badge on the same page. What I want is that as the user types the changes are immediately displayed in the badge. I have added an oninput event, but it seems that the oninput event does not update the razor page because the badge remains blank when I have input changes. The text is only displayed when the focus is lost on TextField.
How can I make it so that when I insert letters, they are immediately displayed on the badge?
Textinput:
<MudTextField @bind-Value="@itemAttribute.Title" @oninput="(e)=> itemAttribute.Title = e.Value.ToString()" />
Badge:
<MudBadge Overlap="false" Style="@($"color: #CFD8DC;")" Color="Color.Transparent" Content="@itemAttribute.Title">
Variable:
[Parameter] public ItemAttribute itemAttribute { get; set; }
Try simply:
<MudTextField @bind-Value="@itemAttribute.Title" Immediate="true" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With