Skip to content

Commit

Permalink
fix: fix changed target getos #657
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed May 8, 2022
1 parent 89a5fb6 commit 54ef5a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/react-moveable/src/react-moveable/groupUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,24 @@ export function triggerChildGesto(
const moveables = moveable.moveables;
const childs = events.map((ev, i) => {
const childMoveable = moveables[i];
const state = childMoveable.state;
let childEvent: any = ev;

if (isStart) {
childEvent = new CustomGesto().dragStart(delta, ev);
} else {
if (!childMoveable.state.gesto) {
childMoveable.state.gesto = datas.childGestos[i];
if (!state.gesto) {
state.gesto = datas.childGestos[i];
}
childEvent = setCustomDrag(ev, childMoveable.state, delta, isPinch, isConvert);
if (!state.gesto) {
return;
}
childEvent = setCustomDrag(ev, state, delta, isPinch, isConvert);
}
const result = (able as any)[type]!(childMoveable, { ...childEvent, parentFlag: true });

if (isEnd) {
childMoveable.state.gesto = null;
state.gesto = null;
}
return result;
});
Expand Down

0 comments on commit 54ef5a0

Please sign in to comment.