Skip to content

v0.4.0

Compare
Choose a tag to compare
@TahaSh TahaSh released this 30 Sep 15:25
· 16 commits to main since this release

This version supports auto-scrolling while dragging.

Features

autoScrollOnDrag (#73)

Enabling autoScrollOnDrag in Swapy's config options will cause the page or container to auto-scroll when dragging an item near the edge.

createSwapy(container, {
  autoScrollOnDrag: true
})

Add hasChanged to swapEnd event (#58)

The swapEnd event object now includes a new parameter, hasChanged, which indicates whether any items were swapped during the drag session.

swapy.onSwapEnd(({ data, hasChanged }) => {
  console.log(hasChanged);
  console.log('end', data);
})

Fixes

  • Fix drag jump for moved parent (#59)
  • Fix scrolling while dragging items (#30)
  • Prevent swapEnd event on click without dragging (#67, #58)
  • Fix swapy.enable() on component remount (when using React's strict mode for example) (#68)