Binding to input datetime-local deletes day when entering 0 first #44796
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Describe the bug
Binding to an input of type datetime-local behaves different from the default HTML behaviour.
Take a look on this:
As you can see when I enter "0" for month it resets the input to a default datetime. When I press only the corresponding number of the month it works as expected. This also happens when you enter a 0 first on day.
The code for this is:
Now lets compare it to blank HTML:
As you can see in plain HTML the input does not reset when typing a 0 first.
<input type="datetime-local" />
Expected Behavior
It should work just like in HTML. Most people will type 08 to enter the month, not just 8. However both options should be possible.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
dotnet --info .NET SDK: Version: 6.0.402 Commit: 6862418796 Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.402\ global.json file: Not found Host: Version: 6.0.10 Architecture: x64 Commit: 5a400c212a .NET SDKs installed: 6.0.402 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
Anything else?
This might be connected with #40660
The text was updated successfully, but these errors were encountered: