fix: [v5] FluentValidationMessage icon shrinks when the validation message wraps
Maintainers usually reply within 1 day
@vnbaaij is already working on this.
Since Dec 2, 2026.
Assessment
This issue has not been assessed yet.
Description
🐛 Bug Report
When a validation message shown by FluentValidationMessage (inside FluentField) is long enough to wrap, the error icon shrinks. The longer the message, the smaller the icon. The icon should always stay 12px wide.
💻 Repro or Code Sample
<EditForm Model="@_model">
<DataAnnotationsValidator />
<FluentNumberField @bind-Value="_model.NumberOfInstalments"
Label="Number of Instalments"
Style="max-width: 150px" />
</EditForm>
@code {
private readonly Model _model = new() { NumberOfInstalments = 43643436 };
private sealed class Model
{
[Range(1, 12, ErrorMessage = "Exceeds the number of valid instalments for this period")]
public int NumberOfInstalments { get; set; }
}
}
- Render the field in a narrow container (e.g.
max-width: 150px). - Trigger validation so the long message wraps over several lines.
- Compare the error icon with a field that has a short, single-line message.
🤔 Expected Behavior
The error icon keeps the same size (12px) whatever the message length, and lines up with the first line of the message.
😯 Current Behavior
The icon is squeezed horizontally and gets smaller as the message gets longer. It is also vertically centred against the whole multi-line message instead of sitting next to the first line.
💁 Possible Solution
FluentValidationMessage.razor renders:
<div message>
@CreateIcon(Icon) @* FluentIcon, Width="12px" *@
@message
</div>
and FluentValidationMessage.razor.css styles it as:
.fluent-validation-message > div[message] {
display: flex;
align-items: center;
}
The icon is a flex item with the default flex-shrink: 1, so it gives up width when the text wraps. Suggested fix:
.fluent-validation-message > div[message] {
display: flex;
align-items: flex-start; /* optional: line the icon up with the first line */
}
.fluent-validation-message > div[message] > svg {
flex-shrink: 0;
}
🔦 Context
We use Fluent UI Blazor v5 inputs in forms where validation messages are often longer than the input is wide (e.g. number fields limited to ~150px). The shrinking icons look inconsistent across fields on the same page. We'd rather fix this upstream than add a local CSS override.
🌍 Your Environment
- OS & Device: Windows 11, PC
- Browser:
- .NET and Fluent UI Blazor library version: .NET 11, Microsoft.FluentUI.AspNetCore.Components 5.1.0 (same CSS still on
dev-v5)
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 500
- Avg merge
- 15h 28m
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/fluentui-blazor
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/fluentui-blazor#5721 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/fluentui-blazor#5684 ·
Maintainers usually reply within 1 day
-
fix: option list stays open after a mouse pick in single-select FluentAutocompletePossibly taken @dvoituron claimed this 1 day ago. Open
microsoft/fluentui-blazor#5715 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
microsoft/fluentui-blazor#5711 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/fluentui-blazor#5707 ·
Maintainers usually reply within 1 day
All issues in microsoft/fluentui-blazor
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[BUG] speech tts synthesize rejects valid locales such as fil-PH, yue-CN and sr-Latn-RS in --languagePossibly taken @Shizoqua claimed this today. OpenAzure.Mcp.Server needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Project dependencies are outdatedPossibly taken @yasmoradi claimed this today. Opendependencies
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bitfoundation/bitplatform#15616 ·
Maintainers usually reply within 1 day
-
:watch: Not Triaged Pri3
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
area-controls-shell platform/android
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
dotnet/maui#41304 · 1 reaction ·
Maintainers usually reply within 1 day