Fix for closing editor when clicking outside