Closed carlbjorknas closed 3 years ago
Thanks for contacting us. It looks like you're missing the @key
attribute for the elements which are rendered in a loop. You can learn more about this from https://docs.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-6.0#use-key-to-control-the-preservation-of-elements-and-components
Describe the bug
When toggling visibility of inputs, the input can get the wrong validation status color (due to input component reuse?).
To Reproduce
Code
nuget: microsoft.aspnetcore.components.dataannotations.validation\3.2.0-rc1.20223.4 ``` @page "/" @using System.ComponentModel.DataAnnotations;Input toggle test
Further technical details
dotnet --info Output
``` .NET SDK (reflecting any global.json): Version: 5.0.401 Commit: 4bef5f3dbf Runtime Environment: OS Name: Windows OS Version: 10.0.19043 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.401\ Host (useful for support): Version: 5.0.10 Commit: e1825b4928 .NET SDKs installed: 5.0.302 [C:\Program Files\dotnet\sdk] 5.0.401 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] ```