Sped up the logic around detecting elements to automatically disable text selection.