Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-dnd-action

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-dnd-action - npm Package Compare versions

Comparing version 0.8.5 to 0.8.6

2

package.json

@@ -43,3 +43,3 @@ {

"description": "*An awesome drag and drop library for Svelte 3 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *",
"version": "0.8.5",
"version": "0.8.6",
"repository": {

@@ -46,0 +46,0 @@ "type": "git",

@@ -55,6 +55,11 @@ // external events

export function dispatchDraggedElementLeftContainerForAnother(containerEl, draggedEl) {
/**
* @param containerEl - the dropzone the element left
* @param draggedEl - the dragged element
* @param theOtherDz - the new dropzone the element entered
*/
export function dispatchDraggedElementLeftContainerForAnother(containerEl, draggedEl, theOtherDz) {
containerEl.dispatchEvent(
new CustomEvent(DRAGGED_LEFT_EVENT_NAME, {
detail: {draggedEl, type: DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER}
detail: {draggedEl, type: DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER, theOtherDz}
})

@@ -61,0 +66,0 @@ );

@@ -69,3 +69,3 @@ import {findWouldBeIndex, resetIndexesCache} from "./listUtil";

if (dz !== lastDropZoneFound) {
lastDropZoneFound && dispatchDraggedElementLeftContainerForAnother(lastDropZoneFound, draggedEl);
lastDropZoneFound && dispatchDraggedElementLeftContainerForAnother(lastDropZoneFound, draggedEl, dz);
dispatchDraggedElementEnteredContainer(dz, indexObj, draggedEl);

@@ -72,0 +72,0 @@ lastDropZoneFound = dz;

@@ -128,8 +128,8 @@ import {

printDebug(() => ["dragged entered", e.currentTarget, e.detail]);
isDraggedOutsideOfAnyDz = false;
let {items, dropFromOthersDisabled} = dzToConfig.get(e.currentTarget);
if (dropFromOthersDisabled && e.currentTarget !== originDropZone) {
printDebug(() => "drop is currently disabled");
printDebug(() => "ignoring dragged entered because drop is currently disabled");
return;
}
isDraggedOutsideOfAnyDz = false;
// this deals with another race condition. in rare occasions (super rapid operations) the list hasn't updated yet

@@ -173,3 +173,8 @@ items = items.filter(item => item[ITEM_ID_KEY] !== shadowElData[ITEM_ID_KEY]);

shadowElDropZone = undefined;
if (e.detail.type === DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY) {
const {type, theOtherDz} = e.detail;
if (
type === DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY ||
(type === DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER && theOtherDz !== originDropZone && dzToConfig.get(theOtherDz).dropFromOthersDisabled)
) {
printDebug(() => "dragged left all, putting shadow element back in the origin dz");
isDraggedOutsideOfAnyDz = true;

@@ -176,0 +181,0 @@ shadowElDropZone = originDropZone;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc