Skip to content

Commit 87e336a

Browse files
committed
#277: * fixed handle & filter
1 parent 2d861f8 commit 87e336a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Sortable.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@
275275
return; // only left button or enabled
276276
}
277277

278-
if (options.handle) {
279-
target = _closest(target, options.handle, el);
280-
}
281-
282278
target = _closest(target, options.draggable, el);
283279

280+
if (!target) {
281+
return;
282+
}
283+
284284
// get the index of the dragged element within its parent
285285
oldIndex = _index(target);
286286

@@ -308,6 +308,12 @@
308308
}
309309
}
310310

311+
312+
if (options.handle && !_closest(originalTarget, options.handle, el)) {
313+
return;
314+
}
315+
316+
311317
// Prepare `dragstart`
312318
if (target && !dragEl && (target.parentNode === el)) {
313319
tapEvt = evt;

0 commit comments

Comments
 (0)