micromasters icon indicating copy to clipboard operation
micromasters copied to clipboard

When user presses ESC on a profile dialog, they lose the work for that dialog

Open noisecapella opened this issue 8 years ago • 4 comments

Ideas:

  • display confirmation if user presses ESC and there is modified data
  • preserve dialog data so user can get back to it (at least if editing)

noisecapella avatar Jun 17 '16 21:06 noisecapella

Here is I think what we should do here:

  1. If the user has not entered anything in the form, and hits ESC, just close the dialog.
  2. If the user is in a field typing (ie. if the field is in focus) hitting ESC does nothing.
  3. If the user has entered any info in the form, and no field is in focus, hitting ESC will prompt a confirmation dialog. ("Are you sure? Closing this form will lose the information you entered.")

If the above takes too much effort, we can probably just do #2. I feel that use case #3 is an edge case, but I may be wrong.

roberthouse54 avatar Jun 22 '16 18:06 roberthouse54

@roberthouse54 A couple of comments, not necessary proposing a solution:

  • Not sure your 2 and 3 are different. It seems like the problem we are trying to solve is "user hits ESC by mistake". whether the user is in the field typing or not, it's not that different.
  • It seems like ESC is equivalent to clicking "Cancel" button. Se we should implement the same behavior for both events

Ferdi avatar Jun 22 '16 19:06 Ferdi

I actually mainly copied what Github did... my sense is that this is an edge case, but I am trying to do what is expected. I think most normal users do not hit ESC when in a form. That is sort of power user/programmer behavior.

roberthouse54 avatar Jun 22 '16 19:06 roberthouse54

So, let's just do what I proposed in the comment above. I feel that most users will not his escape on purpose, and if they hit it by mistake they should not lose the info they have entered. So in other words, the user should have to hit save or cancel to close the dialog.

roberthouse54 avatar Aug 01 '16 19:08 roberthouse54