Don't get selection if no active element

Fixes #694.

Previously, it could be that there was an active element that was removed in between mousedown and mouseup.