You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
If an external tag helper (or if the user sets the class attribute on a tag directly) has set values for the class attribute, use of any of the taghelpers here will overwrite those values.
Have a change available to remedy this, can raise a pull request if I can be made a contributor here - or alternatively the suggested code change is as follows:
protected void SetClassAttribute(TagHelperOutput output, string attributeValue)
{
if (output.Attributes.TryGetAttribute(HtmlAttributes.ClassAttribute, out var currentClassValue))
{
attributeValue = $"{attributeValue} {currentClassValue.Value}";
}
output.Attributes.SetAttribute(HtmlAttributes.ClassAttribute, attributeValue);
}
protected void UpdateClasses(TagHelperOutput output)
{
const string space = " ";
var prepended = "";
var classesFromUser = string.IsNullOrWhiteSpace(Classes) ? "" : Classes;
foreach (var item in ClassesToPrepend)
{
prepended += item + space;
}
var classes = prepended.Trim()
+ (string.IsNullOrWhiteSpace(classesFromUser) ? "" : space + classesFromUser);
SetClassAttribute(output, classes);
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If an external tag helper (or if the user sets the class attribute on a tag directly) has set values for the class attribute, use of any of the taghelpers here will overwrite those values.
Have a change available to remedy this, can raise a pull request if I can be made a contributor here - or alternatively the suggested code change is as follows:
The text was updated successfully, but these errors were encountered: