From 7b883048741fc5ec9a5e2ab214560547d67bff8b Mon Sep 17 00:00:00 2001 From: Ryan Deba Date: Wed, 20 Dec 2017 18:59:24 -0600 Subject: [PATCH] skip non-selectable parents in select-parent command --- src/commands/view/SelectParent.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/view/SelectParent.js b/src/commands/view/SelectParent.js index 2629f7fee..6b5ad8461 100644 --- a/src/commands/view/SelectParent.js +++ b/src/commands/view/SelectParent.js @@ -1,9 +1,14 @@ module.exports = { run(editor) { - const comp = editor.getSelected(); - const coll = comp && comp.collection; - coll && coll.parent && editor.select(coll.parent); + var comp = editor.getSelected() && editor.getSelected().parent(); + + // recurse through the parent() chain until a selectable parent is found + while (comp && !comp.get("selectable")) { + comp = comp.parent(); + } + + comp && editor.select(comp); } };