Skip to content

janbensch/InputTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InputTest

A minimum working example of an HTML validation error caused by a closing input tag generated by Blazor

Description

The default component InputText (https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web/src/Forms/InputText.cs) in .NET 6 and .NET 7 generates an invalid HTML-Tag.

The input tag is defined as a void element, which must not be closed. In this minimum working example the default Blazor template in .NET 7 is used. The only edit is in the index page (index.razor), where a InputText component is added and the content is displayed on the same page.

Expected behavior

The generated HTML code for the index component should be <input id="Test">. But the generated code consists of <input id="Test"></input>, which violates html specs. It can be reproduced by copying the generated source code into the W3C validator.

image

About

Minimum working example for showing error in validating HTML generated by Blazor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published