fix(SorableList): generate two client item when use clone mode#630
Merged
fix(SorableList): generate two client item when use clone mode#630
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the SortableList JavaScript handler by making the onAdd event async (awaiting the .NET call) and removing the extra cloned item when using clone pullMode. Sequence diagram for async onAdd event and clone item removal in SortableListsequenceDiagram
participant JS as "SortableList.razor.js"
participant DotNet as ".NET Invoke Handler"
JS->>DotNet: invokeMethodAsync('TriggerAdd', items)
Note over JS,DotNet: Await .NET method completion
alt event.pullMode == 'clone'
JS->>JS: event.item.remove()
end
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 fixes an issue where sortable list items were being duplicated when using clone mode. The fix ensures that when an item is cloned and added to a new list, the cloned DOM element is properly removed after the server-side state is updated.
Key Changes:
- Modified the
onAddevent handler to be asynchronous and wait for the server-sideTriggerAddmethod to complete - Added logic to remove the cloned DOM element after successful server-side processing when in clone mode
- Updated version number and package references to support both Visual Studio 17.0 and 18.0
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| SortableList.razor.js | Fixed clone mode duplicate item issue by making onAdd async and removing cloned elements after server processing |
| BootstrapBlazor.Sortable.csproj | Added conditional version configuration for different Visual Studio versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or 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 #629
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Make the onAdd handler asynchronous and remove extra cloned items when using clone mode to prevent duplicate list entries.
Bug Fixes:
Enhancements: