Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the Vditor component’s input handling so that its internal value state is always updated on JS-invoked input events, even when no input callback is registered, and updates the file copyright header. Sequence diagram for Vditor JS-invoked input handlingsequenceDiagram
actor User
participant BrowserVditorJS
participant BlazorRuntime
participant VditorComponent
participant AppConsumer
User->>BrowserVditorJS: Type text in editor
BrowserVditorJS->>BlazorRuntime: invoke TriggerInputAsync(value)
BlazorRuntime->>VditorComponent: TriggerInputAsync(value)
activate VditorComponent
VditorComponent->>VditorComponent: _lastValue = value
VditorComponent->>VditorComponent: CurrentValue = value
alt OnInputAsync is configured
VditorComponent->>AppConsumer: OnInputAsync(value)
AppConsumer-->>VditorComponent: Task completed
else OnInputAsync is null
VditorComponent->>VditorComponent: Skip invoking callback
end
deactivate VditorComponent
VditorComponent-->>BlazorRuntime: Task completed
BlazorRuntime-->>BrowserVditorJS: return
BrowserVditorJS-->>User: Updated editor reflects bound value
Class diagram for updated Vditor input handlingclassDiagram
class Vditor
Vditor : string _lastValue
Vditor : string CurrentValue
Vditor : Task TriggerInputAsync(string value)
Vditor : Func~string, Task~ OnInputAsync
class AppConsumer
AppConsumer : void ConfigureVditor()
AppConsumer : Task OnVditorInputAsync(string value)
Vditor --> AppConsumer : optional_OnInputAsync_callback
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 enables proper two-way binding support for the Vditor markdown editor component by ensuring the component's value is updated during input events regardless of whether an OnInputAsync callback is registered. The change fixes issue #744.
- Moves
CurrentValueand_lastValueassignments outside theOnInputAsyncnull check to support two-way binding - Updates copyright header to current standard format (
BootstrapBlazor & Argo Zhang (argo@live.ca)) - Increments package version to 10.0.1
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/BootstrapBlazor.Vditor/Vditor.razor.cs | Fixes TriggerInputAsync to update component value unconditionally, enabling two-way binding; updates copyright header to current format |
| src/components/BootstrapBlazor.Vditor/BootstrapBlazor.Vditor.csproj | Bumps package version to 10.0.1 |
💡 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 #744
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Ensure Vditor component updates its internal value on input events regardless of callbacks and refresh copyright metadata.
New Features:
Enhancements: