I have made a dialog that is shown by pressing on a button. I would like to hide it by pressing anywhere else or pressing the escape key. Is there a good way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To close the dialog on escape key press, just set
closeOnEscapeastruein the dialog initializer code. To close the dialog on any click outside of the dialog, see this answer.