question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blazor InputDate Error in FireFox

See original GitHub issue

I use an InputDate control as:

                    <div class="form-group">
                        <label for="@("Birthdate" + usr.UsrId.ToString())">@L["lblBirhdate"]</label>
                        <InputDate @bind-Value=usr.PusrBirhdate class="form-control" id="@("Birthdate" + usr.UsrId.ToString())" @onkeypress="OnDateKeyPress" required/>
                        <ValidationMessage For="() => usr.PusrBirhdate" @Required="true" />
                    </div>

Describe the bug

A clear and concise description of what the bug is.

When I press the number: 0 in any date fields, it try to validate the date as in this example, the mouth as: 00

image

I get as soon as the keypress is done, an unhandled error exception as

image

System.InvalidOperationException: InvalidCharacterError: String contains an invalid character
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)


To Reproduce

Insert an InputDate in a Blazor page, Open it in a Firefox browser. <InputDate class="form-control" id="Birthdate" required/>

Run it, insert a 00 for the month by typing only 0

Exceptions (if any)

System.InvalidOperationException: InvalidCharacterError: String contains an invalid character at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)

Further technical details

  • ASP.NET Core version 3.1.3
  • The IDE (VS / VS Code/ VS4Mac) you’re running on, and it’s version : VS 2019 Version 16.7.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
captainsafiacommented, Aug 21, 2020

Glad you tracked down the issue! Closing this now.

0reactions
frablasercommented, Aug 20, 2020

Finally, I found the problem, it was the damned @Required=“true” who fail with the FluentValidation… You can close it…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inputdate doesn't work on internet explorer 11 (blazor)
hi everyone I am using blazor and i noticed that inputdate does not open the datapicker on ie, is there any way to...
Read more >
ASP.NET Core Blazor forms and input components
The Blazor framework supports forms and provides built-in input ... InputDate<TValue> and InputNumber<TValue> support error message ...
Read more >
Blazor RZ10001 The type of component 'InputDate' cannot ...
Error RZ10001 The type of component 'InputDate' cannot be inferred based on the values provided. Consider specifying the type arguments directly ...
Read more >
<input type="month"> - HTML: HyperText Markup Language
<input> elements of type month create input fields that let the user enter a month and year allowing a month and year to...
Read more >
KeyNotFoundException in DatePicker and DateTimePicker ...
Just create a Blazor WASM Client project. Add the DatePicker. Publish with AOT and run in Firefox. Current culture is set to german....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found