set the state of the dropdown close and open handler