Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adds support for a ShowLabel parameter in the Vditor component by conditionally rendering a BootstrapLabel, and adjusts the OnAfterRenderAsync lifecycle method to remove an early return so that initialization logic flows correctly. Sequence diagram for Vditor component rendering with ShowLabelsequenceDiagram
participant Vditor
participant BootstrapLabel
Vditor->>Vditor: Render()
alt IsShowLabel == true
Vditor->>BootstrapLabel: Render(required, for, ShowLabelTooltip, Value)
end
Vditor->>Vditor: Render <div> with attributes
Class diagram for updated Vditor component with ShowLabel parameterclassDiagram
class Vditor {
+bool IsShowLabel
+bool Required
+string Id
+string DisplayText
+bool ShowLabelTooltip
+Dictionary<string, object> AdditionalAttributes
+string ClassString
+string Value
+Task OnAfterRenderAsync(bool firstRender)
}
class BootstrapLabel {
+bool required
+string for
+bool ShowLabelTooltip
+string Value
}
Vditor --> BootstrapLabel : conditionally renders when IsShowLabel
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Pull Request Overview
This PR bumps the version to 9.0.1 and makes two key changes to the Vditor component: adds label support for form validation and fixes a rendering logic issue in the OnAfterRenderAsync lifecycle method.
- Added BootstrapLabel rendering support when IsShowLabel is true
- Removed early return in OnAfterRenderAsync on first render, allowing value synchronization to occur
- Bumped version from 9.0.0 to 9.0.1
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Vditor.razor | Added conditional label rendering using IsShowLabel property from ValidateBase |
| Vditor.razor.cs | Removed early return statement in OnAfterRenderAsync to allow value updates on first render |
| BootstrapBlazor.Vditor.csproj | Bumped package version to 9.0.1 |
Comments suppressed due to low confidence (1)
src/components/BootstrapBlazor.Vditor/Vditor.razor.cs:92
- Removing the early return on firstRender allows the value synchronization logic (lines 85-92) to execute during the first render. However, at this point _vditor is still null because InvokeInitAsync() hasn't been called yet (it's called after OnAfterRenderAsync in the Blazor lifecycle). This means the setValue call will be skipped anyway due to the null check on line 88, making the removal of the early return ineffective for firstRender. The logic should either keep the early return, or ensure _vditor initialization happens before this check.
if (firstRender)
{
_lastValue = Value;
}
if (_lastValue != Value)
{
_lastValue = Value;
if (_vditor != null)
{
await _vditor.InvokeVoidAsync("setValue", Value, true);
}
}
💡 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.
Link issues
fixes #652
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add support for an optional label in the Vditor component and ensure it updates correctly beyond the first render
New Features:
Bug Fixes: