Added the collapsing of any selected ranges to fix inconsistent editor activation.