Skip to content

Commit

Permalink
feat: support stopDrag on drag #775
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Oct 30, 2022
1 parent c3ee847 commit d950472
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ export function triggerAble(
let isForceEnd = false;

// end ables
if (isStart && (isDragStop || (eventAbles.length && !isUpdate))) {
isForceEnd = isDragStop || eventAbles.filter(able => {
if (isDragStop) {
isForceEnd = true;
}
if (!isForceEnd && isStart && eventAbles.length && !isUpdate) {
isForceEnd = eventAbles.filter(able => {
const ableName = able.name;
const nextDatas = datas[ableName];

Expand All @@ -132,8 +135,6 @@ export function triggerAble(
childMoveable.state.gestos = {};
});
}
}
if (isFirstStart && isForceEnd) {
eventAbles.forEach(able => {
able.unset && able.unset(moveable);
});
Expand Down

0 comments on commit d950472

Please sign in to comment.