Skip to content

Pass css class in <ValidationSummary /> to the generated <ul> #43860

@ChristopherHaws

Description

@ChristopherHaws

Is there an existing issue for this?

  • I have searched the existing issues

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

I am trying to pass additional css classes to the generated ul element. I am applying general formatting via the validation-errors css class, but I would like to be able to pass utility classes for spacing (i.e. pt-2 to add 8px of padding to the top of the validation summary).

Describe the solution you'd like

Update <ValidationSummary /> to pass unmatched attributes (via splatting) to the validation-errors element. In the case of class, it should append the passed in classes to the existing validation-errors class.

Additional context

For example:

<ValidationSummary class="pt-2" data-test="validation-errors" />

should result in:

<ul class="validation-errors pt-2"  data-test="validation-errors">
    <!-- Validation Errors -->
</ul>

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futuregood first issueGood for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issue
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions