fix infinite loop when selectOnHover is true