MudBlazor/MudBlazor

MudNumericField T="decimal" rendering onload issue

Fechada

#11.173 aberto em 9 de abr. de 2025

 (6 comentários) (8 reações) (0 responsável)C# (1.631 forks)batch import
bughas workaroundhelp wantedlocalization

Métricas do repositório

Stars
 (10.394 estrelas)
Métricas de merge de PR
 (Mesclagem média 6d 6h) (108 fundiu PRs em 30d)

Description

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

MudNumericField

What happened?

When I use MudNumericField for decimal type (with precision after dot), value does not render on load. For example, that render only when I use scroll or press into then out of the MudNumericField component.

<MudNumericField T="decimal" Value="@(2.00000M)" Label="Not rendering value at start"/>

Another unit tests:

  • not working: <MudNumericField T="decimal" Value="@(2.00000M)" Label="Not rendering value at start" Culture="new CultureInfo("pl-PL")"/>

  • working: <MudNumericField T="decimal" Value="@(2.00000M)" Label="Ok" Format="#,0.00000"/> <MudNumericField T="decimal" Value="@(2)" Label="Ok"/>

Conclusion: Looks like Format parameter is required for rendering value 'onload' with specified precision.

Expected behavior

Value visibility 2.00000 on load (without clicking / scrolling).

Reproduction link

https://try.mudblazor.com/snippet/ckQzYyaNLsGvPPWm

Reproduction steps

  1. Create empty InteractiveServer or use: dotnet new mudblazor --interactivity Server --name MyApplication --all-interactive
  2. Paste anywhere: <MudNumericField T="decimal" Value="@(2.00000M)" Label="Not rendering value at start"/>

Relevant log output

Version (bug)

8.3.0, 8.5.1

Version (working)

No response

What browsers are you seeing the problem on?

Edge

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guia do colaborador