applying collapse opening with keyboard