From 56e057be59109b4421038a251d2ca7c675dfeadf Mon Sep 17 00:00:00 2001 From: RomanTsukanov Date: Wed, 8 May 2024 11:29:32 +0400 Subject: [PATCH 1/2] Fix the `onCanShowProperty` and drag&drop events --- packages/survey-creator-core/src/creator-base.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/survey-creator-core/src/creator-base.ts b/packages/survey-creator-core/src/creator-base.ts index a9aa4950a4..8ca7c5ecb4 100644 --- a/packages/survey-creator-core/src/creator-base.ts +++ b/packages/survey-creator-core/src/creator-base.ts @@ -447,7 +447,7 @@ export class SurveyCreatorModel extends Base * [View Demo](https://surveyjs.io/survey-creator/examples/hide-category-from-property-grid/ (linkStyle)) */ public onShowingProperty: EventBase = this.addCreatorEvent(); - public onCanShowProperty: EventBase = this.onShowingProperty; + public onCanShowProperty: EventBase = this.onShowingProperty; /** * This event is obsolete. Use the [`onSurveyInstanceCreated`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onSurveyInstanceCreated) event instead. * @deprecated @@ -1744,15 +1744,15 @@ export class SurveyCreatorModel extends Base * @see onDragEnd * @see onDragDropAllow */ - public onDragStart: EventBase = new EventBase(); - public onBeforeDrop: EventBase = this.onDragStart; + 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 onAfterDrop: EventBase = this.onDragEnd; + public onDragEnd: EventBase = this.addCreatorEvent(); + public onAfterDrop: EventBase = this.onDragEnd; private initDragDropSurveyElements() { DragDropSurveyElements.restrictDragQuestionBetweenPages = settings.dragDrop.restrictDragQuestionBetweenPages; From 6af9115ba95c56555791d0b7099b976904f68e58 Mon Sep 17 00:00:00 2001 From: RomanTsukanov Date: Wed, 8 May 2024 12:01:50 +0400 Subject: [PATCH 2/2] Revert drag&drop changes --- 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 8ca7c5ecb4..51b01ef9c1 100644 --- a/packages/survey-creator-core/src/creator-base.ts +++ b/packages/survey-creator-core/src/creator-base.ts @@ -1744,15 +1744,15 @@ export class SurveyCreatorModel extends Base * @see onDragEnd * @see onDragDropAllow */ - public onDragStart: EventBase = this.addCreatorEvent(); - public onBeforeDrop: EventBase = this.onDragStart; + public onDragStart: EventBase = new EventBase(); + 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 onAfterDrop: EventBase = this.onDragEnd; + public onDragEnd: EventBase = new EventBase(); + public onAfterDrop: EventBase = this.onDragEnd; private initDragDropSurveyElements() { DragDropSurveyElements.restrictDragQuestionBetweenPages = settings.dragDrop.restrictDragQuestionBetweenPages;