From 89883c0b17bd2d91735a80d6ccc41b306607c390 Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Thu, 23 May 2024 18:06:45 +0400 Subject: [PATCH 1/2] work for the https://github.com/surveyjs/survey-creator/issues/5478 --- packages/survey-creator-core/src/creator-base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/survey-creator-core/src/creator-base.ts b/packages/survey-creator-core/src/creator-base.ts index eb635f4ad..2edfe208a 100644 --- a/packages/survey-creator-core/src/creator-base.ts +++ b/packages/survey-creator-core/src/creator-base.ts @@ -1754,14 +1754,14 @@ export class SurveyCreatorModel extends Base * @see onDragEnd * @see onDragDropAllow */ - public onDragStart: EventBase = new EventBase(); + public onDragStart: EventBase = this.addCreatorEvent(); public onBeforeDrop: EventBase = this.onDragStart; /** * An event that is raised when users finish dragging a survey element within the design surface. * @see onDragStart * @see onDragDropAllow */ - public onDragEnd: EventBase = new EventBase(); + public onDragEnd: EventBase = this.addCreatorEvent(); public onAfterDrop: EventBase = this.onDragEnd; private initDragDropSurveyElements() { DragDropSurveyElements.restrictDragQuestionBetweenPages = From aadc5b9d4b7d9206a7bed1be9159f5b52b858658 Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Tue, 11 Jun 2024 15:36:58 +0400 Subject: [PATCH 2/2] work for the https://github.com/surveyjs/survey-creator/issues/5478 --- packages/survey-creator-core/src/creator-base.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/survey-creator-core/src/creator-base.ts b/packages/survey-creator-core/src/creator-base.ts index 49a2d0f49..60b9fd9ae 100644 --- a/packages/survey-creator-core/src/creator-base.ts +++ b/packages/survey-creator-core/src/creator-base.ts @@ -1766,14 +1766,14 @@ export class SurveyCreatorModel extends Base * @see onDragEnd * @see onDragDropAllow */ - public onDragStart: EventBase = this.addCreatorEvent(); + public onDragStart: EventBase = this.addCreatorEvent(); public onBeforeDrop: EventBase = this.onDragStart; /** * An event that is raised when users finish dragging a survey element within the design surface. * @see onDragStart * @see onDragDropAllow */ - public onDragEnd: EventBase = this.addCreatorEvent(); + public onDragEnd: EventBase = this.addCreatorEvent(); public onAfterDrop: EventBase = this.onDragEnd; private initDragDropSurveyElements() { DragDropSurveyElements.restrictDragQuestionBetweenPages = @@ -1783,7 +1783,7 @@ export class SurveyCreatorModel extends Base let isDraggedFromToolbox = false; this.dragDropSurveyElements.onDragStart.add((sender, options) => { isDraggedFromToolbox = !sender.draggedElement.parent; - this.onDragStart.fire(sender, options); + this.onDragStart.fire(this, options); this.startUndoRedoTransaction("drag drop"); }); this.dragDropSurveyElements.onDragEnd.add((sender, options) => { @@ -1791,7 +1791,7 @@ export class SurveyCreatorModel extends Base const editTitle = isDraggedFromToolbox && this.startEditTitleOnQuestionAdded; this.selectElement(options.draggedElement, undefined, false, editTitle); isDraggedFromToolbox = false; - this.onDragEnd.fire(sender, options); + this.onDragEnd.fire(this, options); }); } private initDragDropChoices() {