Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker be able to 'esc' to close #48

Closed
m4ttb13 opened this issue Jun 30, 2017 · 3 comments
Closed

DatePicker be able to 'esc' to close #48

m4ttb13 opened this issue Jun 30, 2017 · 3 comments

Comments

@m4ttb13
Copy link

m4ttb13 commented Jun 30, 2017

Currently cannot hit Esc to close the window (even when focus is on it)

@djbuckley djbuckley self-assigned this Jul 3, 2017
@djbuckley
Copy link

mui#35

@djbuckley
Copy link

this stops the date picker handling the escape key as a close request

  requestClose(buttonClicked) {
    if (!buttonClicked && this.props.modal) {

Dialog.js : line 274

if the dialog is set to modal then you can't break out with an escape
datepicker uses modal boxes unless the picker is inline

   const modal = (container === 'inline' ? null : true);

DatePickerDialog.js : line 159

@djbuckley
Copy link

UI guideline examples

  • Apple macOS human interface guidelines
    • Include a Cancel button that responds to the standard cancelation keyboard shortcuts. A Cancel button provides a clear, safe way out of a dialog and returns the computer to the state it was in before the dialog appeared. Make sure the keyboard shortcut Command-period and the Esc (Escape) key are mapped to the Cancel button.

  • Microsoft Windows Experience guidelines
    • Pressing the Esc key always closes an active dialog box. This is true for dialog boxes with Cancel or Close, and even if Cancel has been renamed to Close because the results can no longer be undone.

  • Smashing Magazine modal window web design
    • EXIT STRATEGY: BUTTON, CLICK OUTSIDE WINDOW, ESCAPE KEY LINK
      To improve functionality, always provide an exit button in an upper corner of the window. It is standard practice to use a simple circular button with an “x” graphic, which is clean and quite obvious for the user. In the lightbox shown below, you can clearly see the exit button.

  • Demo of dialogs in Material Design on AngularJS

djbuckley added a commit that referenced this issue Jul 3, 2017
The default behaviour is not for escape to cancel a dialog (see supporting documentation for this in issue #48).
Added a new property to dialog to allow for escape to be disabled, so the old functionality can be enabled if required.
djbuckley added a commit that referenced this issue Jul 3, 2017
added top level disableDismissWithEscapeOnDialog property to date picker which cascades through date picker dialog to dialog so that the escape key can be disabled for dismissing the popup
@djbuckley djbuckley modified the milestone: Accessibility updates Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants