Make sortable detection work in situations where multiple lines are in edit mode
Clean up sortable detection and improve focus behavior