From 14b4a5e74596f50100102b4ccc9baf61ca2c204d Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 22 Mar 2019 18:54:46 +0100 Subject: [PATCH] Include parent in static guides --- src/commands/view/ComponentDrag.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/view/ComponentDrag.js b/src/commands/view/ComponentDrag.js index 823f86973..ded945c73 100644 --- a/src/commands/view/ComponentDrag.js +++ b/src/commands/view/ComponentDrag.js @@ -108,12 +108,14 @@ module.exports = { getGuidesStatic() { let result = []; const el = this.target.getEl(); + const { parentNode = {} } = el; each( - el.parentNode.children, + parentNode.children, item => (result = result.concat(el !== item ? this.getElementGuides(item) : [])) ); - return result; + + return result.concat(this.getElementGuides(parentNode)); }, getGuidesTarget() {