Add CssClass property to ValidationSummary#43928
Conversation
|
Thanks for your PR, @ChristopherHaws. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
bd6eeba to
765808d
Compare
|
@SteveSandersonMS I updated the test to be an E2E test. I had a hell of a time getting selenium to work because I have v105 of chrome installed but the web driver used by the E2E tests is still v103 and chrome doesn't supply old versions of chrome. I had to lookup the build number of chromium that corresponds to v103 of chrome and use that instead. I remember now why I stopped using selenium and switched to playwright. :) I think this PR is ready for review now. Thanks! |
|
Thanks for your PR, @ChristopherHaws. |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
@Nick-Stanton reassigning this to you as @SteveSandersonMS has been busy with other things. |
Nick-Stanton
left a comment
There was a problem hiding this comment.
Hi @ChristopherHaws, thank you for your contribution and apologies for the delay. I made one small request, but otherwise the changes look good.
Since your PR contains new API, you will need to create an API Proposal to go along with your issue. This is done by opening a new issue using the API Proposal template. More information about the process is here. Once the proposal is ready, I will "champion" your changes on your behalf during review. Please let me know if you have any questions.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 43928 in repo dotnet/aspnetcore |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
2894645 to
aabd544
Compare
|
/azp run |
|
Commenter does not have sufficient privileges for PR 43928 in repo dotnet/aspnetcore |
|
@ChristopherHaws thanks for taking the time to draft your proposal. It looks like the commit that moved your new API caused some new build failures. I imagine CI will be clean once those are fixed. While investigating these changes deeper to prepare for API review, I had a couple questions:
<ValidationSummary class="validation-errors pt-2" data-test="validation-errors" />
|
|
@Nick-Stanton Hmm, not sure why the build would be failing. Unfortunately I don't have time to look at that this week, I am super busy at work and have a theater show I am running at night.
The only built-in component I found which allows users to set Most of the built-in components don't allow you to pass I don't know the exact reason that the built-in css class names need to be in this property but I am guessing it is one or many of the following:
|
Ah, checking this more closely, I see that the
That's right, The change in the PR, if I'm reading correctly, would prevent that and force people to have The reason why we combine classes dynamically in In summary it looks as if we already have the desired functionality, i.e., the ability to customize the CSS class name and add arbitrary extra ones just by specifying |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
@SteveSandersonMS The current behavior of <!-- <ValidationSummary /> -->
<ul class="validation-errors">
<li class="validation-message">...</li>
</ul>
<!-- <ValidationSummary class="test" data-test="test" /> -->
<ul data-test="test" class="validation-errors">
<li class="validation-message">...</li>
</ul>I see your point about it being confusing as to whether it replaces or appends the class though. I am coming to blazor after using React for many years where it is pretty common for the classes you pass in to be appended, so I would have assumed that it would be appended. Here are the docs for FluentUI React where you can see that I get that this is not React, so I looked at one of the top Blazor Component libraries to see what they do. MudBlazor defines |
|
@ChristopherHaws Can you provide a repro using an online REPL? I just tried it and it works for me: https://blazorrepl.telerik.com/QRumvqaN29a37x4K49 |
|
Interesting, I had used BlazorFiddle to try it. I guess they are on an old version of Blazor. It's been a while since I was dealing with this issue in our project (we ended up just wrapping |
|
@ChristopherHaws I just looked into it and it looks like they're using a really old version of Blazor. |
|
Closing as this is already supported. |



Add CssClass property to ValidationSummary
API Proposal: #46461
Description
Add
CssClassproperty toValidationSummaryand append the contents to the resultingclassattribute.Fixes #43860, Closes: #46461