dotnet / dotnet/Scaffolding

Bootstrap 5 Input Group Renders Incorrectly Due to ASP Tag Helper Including Hidden __Invariant Field

Open
#3,170 1 comment 0 reactions 0 assignees View on GitHub
area-scaffolding
Dominant language
C#
Stars
818
Forks
260
Avg merge
1d 8h
Merged PRs (30d)
10

Description

In ASP.NET Core MVC projects, [Bootstrap 5 Input Group](https://getbootstrap.com/docs/5.0/forms/input-group/) renders incorrectly due to ASP Tag Helper including hidden __Invariant field in the HTML. Specifically, the right border of the right-most input-group _field_ is not rounded if ASP Helper inserts a hidden input[name="__Invariant"] after the field. This happens when the right-most field is the last part in the input-group and the right-most field's Tag Helper generates a hidden __Invariant input.

Image

```


Test


```

Update could be made to VS.Web.CG.Mvc's Bootstrap 5 site.css template so that appropriate CSS reset rules are included to resolve the issue.

Relevant links:
[https://stackoverflow.com/questions/79481827/strange-invariant-hidden-element-inserted-into-markup](https://stackoverflow.com/questions/79481827/strange-invariant-hidden-element-inserted-into-markup)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.