Browse Source

fix: pass event to opts in onDrag method for better event handling

pull/6487/head
Carlos 1 year ago
parent
commit
9a6adb32f5
  1. 3
      packages/core/src/commands/view/ComponentDrag.ts

3
packages/core/src/commands/view/ComponentDrag.ts

@ -395,7 +395,7 @@ export default {
this.guidesStatic = this.getGuidesStatic(); this.guidesStatic = this.getGuidesStatic();
}, },
onDrag() { onDrag(event) {
const { guidesTarget, opts } = this; const { guidesTarget, opts } = this;
this.updateGuides(guidesTarget); this.updateGuides(guidesTarget);
@ -403,6 +403,7 @@ export default {
opts.guidesInfo && this.renderGuideInfo(guidesTarget?.filter((item) => item.active) ?? []); opts.guidesInfo && this.renderGuideInfo(guidesTarget?.filter((item) => item.active) ?? []);
opts.onDrag?.(this._getDragData()); opts.onDrag?.(this._getDragData());
this.opts.event = event;
this.em.trigger(`${evName}:move`, this.getEventOpts()); this.em.trigger(`${evName}:move`, this.getEventOpts());
}, },

Loading…
Cancel
Save