Pressing esc should close the current dialog
Support cancelling a dialog open any time during its animation
More robust cancel() method