Changed the definition of directive autoSelect to supports minizing