}
if (anActiveDoc.get() && aCurrent.get() && aCurrent->data()->isValid()) {
- if (anActiveDoc->currentFeature(false) != aCurrent)
+ if (anActiveDoc->currentFeature(false) != aCurrent &&
+ ModelAPI_Tools::compositeOwner(anActiveDoc->currentFeature(false)) == aCurrent)
anActiveDoc->setCurrentFeature(aCurrent, false); // #2156 make the current feature back
}