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); } };