The next release of our [edit: java] application will allow users to delete and redact text that they've selected, based on right clicking and choosing one of those options. Unfortunately, we haven't built Undo yet. I know that undo is the best way to handle this situation, and am pushing for us to start working on that for our next release, but until then, how can we protect users from accidental deletions? I'd hate to make a pop-up confirmation or clutter the UI with more buttons - I'm at a loss here as to how we should handle this situation.

Edit per my comment below - Current Dialog:


Proposed Dialog:

Remove ->

5 Answers 5


The only think I can think of is that you don't have a delete option as the first item on the context menu. So you'd have something like this:

-> Safe Option

This way if they'll have to move the mouse onto one of the dangerous delete options and click. While not foolproof it would reduce the chance of accidental deletion.

Other than that I don't think you can do anything without disrupting the user workflow by adding an "Are you sure?" dialog.

(Not having Undo could be a serious problem, but I guess you know that)

  • This is the easiest way I can think of it, just making it more effort (but not unreasonably so) to reach the irreversible options...assuming you do indeed have reversible/safe/whatever options in that context menu.
    – Ben Brocka
    Commented Oct 14, 2011 at 20:10
  • I like this idea - We have three options currently: Properties, Delete, Redact. What if we put Delete and Redact into a submenu called Remove? So it would look like... apparently I can't format a comment - see edit in the question for formatting :)
    – Karen
    Commented Oct 14, 2011 at 20:53
  • @Karen - possibly - hard to tell from the comment ;) (you can't put newlines in comments)
    – ChrisF
    Commented Oct 14, 2011 at 20:55
  • We're going to do the proposed option from my edit above, to make the initial right click be ONLY safe options. In the future, we will have undo which will help mitigate disaster, but for now, I think this will work well without adding any terrible dialogs. Thanks!!
    – Karen
    Commented Oct 20, 2011 at 18:12

The second best is making sure that Delete is not an easy thing to do. Popups are bad, because people get used to just accepting them. As per ChrisF, avoiding making them default is worth while. Not having shortcuts for them, and making them a two click through a menu system may server to help users be sure that they are really sure about doing this.

Another possible option, if it is possible, is for a recommended option that copies deleted text onto the clipboard. As a rule, I would not suggest this, which is why it needs to be an option, but if you do this, at least users have a one-stage undo process.


One option, at least when it comes to buttons, is long-press buttons. The user has to press the delete button for a full second or two for it to trigger. You can do a nice animation in the meanwhile, like a circular border effect that runs like a clock, and resets back quickly when the user lets go. See this Flash control as an example.

Actually you can probably do the same with the DELETE keyboard key. The user has to press it for longer to actually delete anything. Could work, too, but here as well the animation is important feedback because it explains why stuff isn't happening.


A few ideas:

  1. Change delete to cut (as in cut & paste). That way the deleted text is at least on the user's clipboard, so if the command is invoked accidentally, it can be pasted back in.

  2. Write the deleted text out to a log file and and create a simple UI for users to access recently deleted snippets.

  3. Make it a two-step process. The first step (the context menu) would merely mark the text for deletion. You can show the text has been marked for deletion by adding a line through it or changing the background color. Then require the user to click a button to commit changes (actually deleting all of the text that's marked for deletion), or a cancel button to remove all of the deletion markers. (Or skip the extra buttons and make committing deletions part of the save comand.)


The trick is to make the delete action difficult to do accidentally, while still making it quick/simple for users to do if they actually want to delete.
If the delete action is triggered through a button on the screen, you can do a few things:

  1. Probably the most important thing is to keep the Delete button separated from other commonly-used buttons. Don't put Delete right beside Update/Save, a simple misclick might ruin a user's work.
  2. Put a confirmation request on the Delete action. There are two styles you can use:
    A popup: http://projectshadowlight.org/jquery-easy-confirm-dialog/ (only use this if you system does not use popups frequently, otherwise users might just instinctively click 'Ok')
    An inline confirmation: http://nadiana.com/jquery-confirm-plugin#First_Example
  3. Make the Delete component look different from other buttons the user might potentially click (eg: If your buttons have text, and "Save" is a button, make the "Delete" component just some underlined text, like a link) Using noticeably different icons for each action is also good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.