Conversation
… (related to issue #26 )
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Account/Pages/ExternalLogin.razor
Dismissed
Show dismissed
Hide dismissed
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Account/Pages/Manage/ExternalLogins.razor
Dismissed
Show dismissed
Hide dismissed
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Account/Pages/Manage/ExternalLogins.razor
Dismissed
Show dismissed
Hide dismissed
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds dynamic validation styling to BitBlazor form components by automatically applying CSS classes based on validation state. It includes proper resource cleanup via IDisposable, comprehensive test coverage, and a complete sample application demonstrating the features with ASP.NET Core Identity integration.
Changes:
- Added dynamic validation CSS class assignment ("is-invalid" and "just-validate-success-field") to form components
- Implemented IDisposable pattern for proper event handler cleanup in BitFormComponentBase
- Added extensive validation tests for all major form components
Reviewed changes
Copilot reviewed 100 out of 146 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/BitBlazor/Form/BitFormComponentBase.cs | Core validation logic with event subscription, CSS class management, and IDisposable implementation |
| src/BitBlazor/Form/BitInputFieldBase.cs | Integration of validation CSS classes into input field rendering |
| src/BitBlazor/Form/Checkbox/BitCheckbox.* | Added validation CSS class support to checkbox component |
| src/BitBlazor/Form/SelectField/BitSelectField.* | Added validation CSS class support to select component |
| src/BitBlazor/Form/Toggle/BitToggle.* | Added validation CSS class support to toggle component |
| src/BitBlazor/Form/Radio/BitRadioGroup.razor.cs | Updated validation message CSS class |
| tests/BitBlazor.Test/**/*.Rendering.razor | Comprehensive validation tests for form components |
| tests/BitBlazor.Test/_Imports.razor | Added Microsoft.AspNetCore.Components.Forms using directive |
| samples/** | Complete sample application with Identity integration |
| BitBlazor.sln | Added sample projects to solution |
Files not reviewed (1)
- samples/BitBlazor.Sample/BitBlazor.Sample/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improved validation styling and logic for form components in the BitBlazor library. It adds dynamic CSS class assignment for validation states, ensures correct cleanup of event handlers via
IDisposable, and updates tests to verify the new validation behaviors. These changes provide immediate and clear feedback to users about the validity of form fields.Validation logic and styling improvements:
is-invalid,just-validate-success-field) to input fields inBitFormComponentBase<T>, updating them in response to validation state changes. This includes subscribing toOnValidationStateChangedand providing helper methods for adding the appropriate classes. (src/BitBlazor/Form/BitFormComponentBase.cs) [1] [2] [3]just-validate-error-labelCSS class for consistency with new validation styles. (src/BitBlazor/Form/BitFormComponentBase.cs)AddValidationCssClassmethod to the CSS class computation for all relevant form input components, including Checkbox, SelectField, and Toggle, ensuring validation classes are reflected in the rendered HTML. (src/BitBlazor/Form/BitInputFieldBase.cs,src/BitBlazor/Form/Checkbox/BitCheckbox.razor,src/BitBlazor/Form/Checkbox/BitCheckbox.razor.cs,src/BitBlazor/Form/SelectField/BitSelectField.razor,src/BitBlazor/Form/SelectField/BitSelectField.razor.cs,src/BitBlazor/Form/Toggle/BitToggle.razor,src/BitBlazor/Form/Toggle/BitToggle.razor.cs) [1] [2] [3] [4] [5] [6] [7]Resource cleanup and lifecycle management:
IDisposablepattern inBitFormComponentBase<T>to detach event handlers and prevent memory leaks. (src/BitBlazor/Form/BitFormComponentBase.cs) [1] [2]Testing enhancements:
tests/BitBlazor.Test/Form/Checkbox/BitCheckboxTest.Rendering.razor,tests/BitBlazor.Test/Form/Datepicker/BitDatepickerTest.Rendering.razor,tests/BitBlazor.Test/Form/NumberField/BitNumberFieldTest.Rendering.razor) [1] [2] [3] [4] [5]