Blazor SSR 환경에서 MudTextField 의 입력값중 소문자를 대문자로 변경하는 방법입니다.
SSR 환경이기 때문에 TextUpdateSuppression 값을 "false" 로 설정해야 합니다.
<MudTextField @bind-Value="test" TextUpdateSuppression="false"
@bind-Value:after="() => { test = test.ToUpper(); StateHasChanged(); }"
Immediate="true" Variant="Variant.Outlined" />
@code {
private string test = "";
}
결과

위 동작을 보면 알수 있듯이 붙여넣기동작도 정상 동작합니다.
아래는 다른 방법들입니다.
<MudTextField Value="@test" T="string"
ValueChanged="@OnValueChanged"
Immediate="true" TextUpdateSuppression="false"
Variant="Variant.Outlined" />
@code {
private string test = "";
private Task OnValueChanged(string val)
{
test = val.ToUpper();
return InvokeAsync(StateHasChanged);
}
}
<MudTextField @bind-Value="otherTest" T="string"
Immediate="true" Variant="Variant.Outlined"
TextUpdateSuppression="false" />
@code {
private string _otherTest = "";
private string otherTest
{
get => _otherTest;
set
{
if (_otherTest != value)
{
_otherTest = value.ToUpperInvariant();
InvokeAsync(StateHasChanged);
}
}
}
}
참고
https://github.com/MudBlazor/MudBlazor/issues/11592
MudTextField: Not Updating Value in Blazor Server · Issue #11592 · MudBlazor/MudBlazor
Things to check I have searched the existing issues for this bug To rule out a caching problem I made sure the bug also happens in an incognito tab Bug type Component Component name Text Field What...
github.com
| MudSelectExtended 로 가상화 처리하기 (0) | 2025.12.09 |
|---|---|
| MudBlazor 의 Mask 속성 이용한 입력 문자 제한하기 (0) | 2025.12.09 |
| IIS 애플리케이션 풀 환경변수 설정으로 Blazor 멀티사이트 구성하기 (0) | 2025.10.30 |
| Blazor 멀티사이트 구성 (0) | 2025.10.29 |
| 두 개의 Datasheet 간 클릭 이동 연동하기 - BlazorDatasheet (0) | 2025.10.23 |