Changes since preview 4
Bug Fixes (sortableInterop.js)
- Fixed clone detection - Changed options.group.pull === 'clone' to evt.pullMode === 'clone'
- Was incorrectly checking the target list's options instead of the actual drag operation mode
- Items now drop in the correct position when cloning between lists
- Fixed duplicate DOM elements - Added evt.item.remove() in the onAdd handler
- Sortable.js inserts a cloned DOM element, but Blazor renders its own
- Removing the Sortable clone prevents duplicate items appearing
New Sortable Component Features (Sortable.razor.cs)
- OnItemDropped event - New callback fired when item is dropped (reorder or cross-list)
- Provides SortableDroppedEventArgs with:- Item, TargetSortableId, SourceSortableId
- NewIndex, OldIndex
- ItemBefore, ItemAfter
- IsCrossListMove property
- Id parameter - Optional identifier to identify which list received a drop
- New helper methods:
- MoveOrInsertItem(item, newIndex) - For syncing state from external updates
- RemoveItemIfExists(item) - Removes item if found
- SyncItems(orderedItems) - Replaces entire list with new order
- List reference tracking - Detects when list reference changes (not just contents) to properly re-initialize JS
New E2E Test Suite (BlazorSortableJS.Tests.E2E)
- 12 PuppeteerSharp tests covering SimpleList, SharedLists, DisableSorting, Nested, and Dynamic examples