dotnet / dotnet/aspnetcore

Allow use of 'Addition assignment operator' in TagHelper HtmlAttribute

Open
#54,045 0 comments 0 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I want to be able to optionally append to a tag helper propriety instead of overwrite.

### Describe the solution you'd like

Use the cshtml syntax `column-class+=" new value"` with strings to append to an existing default value.

### Additional context

Currently I can manually fake this syntax by creating a second property and using a plus in the `HtmlAttributeName` and then handling it in code.
``` csharp
[HtmlAttributeName("column-class+")]
public string? ColumnClassAppend { get; set; }
```

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.