From e90f3aaca62ee32619d79ab395e1eb14260ac30e Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 27 Aug 2023 13:53:08 +0400 Subject: [PATCH] Use target spot check in ComponentView --- src/dom_components/view/ComponentView.ts | 3 ++- src/utils/Sorter.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dom_components/view/ComponentView.ts b/src/dom_components/view/ComponentView.ts index 0a0eab1a0..94426401f 100644 --- a/src/dom_components/view/ComponentView.ts +++ b/src/dom_components/view/ComponentView.ts @@ -242,13 +242,14 @@ Component> { const actualCls = el.getAttribute('class') || ''; const cls = [actualCls]; const noCustomSpotSelect = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Select); + const noCustomSpotTarget = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Target); switch (status) { case 'selected': noCustomSpotSelect && cls.push(selCls); break; case 'selected-parent': - cls.push(selectedParentCls); + noCustomSpotTarget && cls.push(selectedParentCls); break; case 'freezed': cls.push(freezedCls); diff --git a/src/utils/Sorter.ts b/src/utils/Sorter.ts index e6558c1e7..952c29633 100644 --- a/src/utils/Sorter.ts +++ b/src/utils/Sorter.ts @@ -501,7 +501,7 @@ export default class Sorter extends View { const { Select, Hover, Spacing } = CanvasSpotBuiltInTypes; [Select, Hover, Spacing].forEach(type => cv.removeSpots({ type })); cv.addSpot({ ...spotTarget, component: model as any }); - !cv.hasCustomSpot(targetSpotType) && model.set('status', 'selected-parent'); + model.set('status', 'selected-parent'); this.targetModel = model; } }