Prevent getParentElement from looking past the composer container

Rebased: #58