Skip to content

In Blazor .Net 9 the component input type=date" resets the value while tipying when it calls the handler #61582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vsfeedback opened this issue Apr 21, 2025 · 0 comments
Labels
area-blazor Includes: Blazor, Razor Components Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author.

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
I have a Blazor component to input the date, but when it calls the handler ValueChanged it resets the value while writting the year
date bug.mp4
writting the year. Probably it is related to the local format, currently I am using es-es.

        <input type="date"
               class="form-control @Class"
               TValue="DateOnly"
               @bind="_date" @bind:event="onchange" @bind:after="OnDateChange" />

@code{
    protected DateOnly? _date = null;

    [Parameter]
    public DateOnly? Value
    {
        get => _date;
        set{
            _date = value;
        }
    }

    /* Required for @bind-Value="model.data"  */
    [Parameter]
    public EventCallback<DateOnly?> ValueChanged { get; set; }

    protected async Task OnDateChange()
    {
        Validate();
        if (ValueChanged.HasDelegate){
            await ValueChanged.InvokeAsync(_date);
        }
    }    
}

Original Comments

Feedback Bot on 11/29/2024, 04:33 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 3/6/2025, 06:01 AM:

We detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Apr 21, 2025
@dotnet-policy-service dotnet-policy-service bot added the Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author.
Projects
None yet
Development

No branches or pull requests

2 participants