Skip to content

2.0.0

Latest

Choose a tag to compare

@jbomhold3 jbomhold3 released this 01 Jan 12:48
· 2 commits to master since this release

Changes since preview 4

Bug Fixes (sortableInterop.js)

  1. 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
  2. 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)

  1. 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
  2. Id parameter - Optional identifier to identify which list received a drop
  3. 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
  4. 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