Let's say that a web page has a click-to-edit text field. Clicking it would convert the displayed text to a text field with a blue outline, and allow the user to start editing the text. Editing would end and the changes would be saved if the user clicks away (blurs the field), or presses Enter.

An English-language user will not normally press the ESC key when typing, and so I would normally bind the ESC key to cause editing to end and cause changes to be discarded.

However, it occurred to me that for some languages, like Japanese, the user may use the browser's IME editor. This would mean that a keystroke causes a menu of symbols to appear, and the user can press the ESC key to abort selection of a symbol.

The risk would be that if an IME user accidentally presses ESC more than once, it will abort and discard all of the changes. This could be especially painful if the user has typed multiple lines of text into a multi-line text field.

Since I only know English, I'm not sure how common it is for IME users to press the ESC key.

Should I avoid binding the ESC key to abort and discard changes? Obviously, I would not abort if they only press the ESC key once to clear the symbol they are currently choosing in the IME editor.

2 Answers 2


I am not sure that you'll get this type of data unless there is some keystroke capture application running on a lot of computers while the IME editor is running.

For any destruction actions, the fail safe option is to allow user confirmation on the action rather than to simply hope that it is not something that the user is likely to do. There may be other reasons why even someone using English language settings might press the ESC key more than once.

Again, because this is a potentially destructive action, you probably don't want to make assumptions about what a user might or might not do (at least without analytics data or extensive testing), so you should just create a fail safe option and then you won't have to worry about this being an issue.

  • 1
    Thanks. I was hoping that someone that regularly uses the IME editor could provide some insight into their use of the Esc key, just as I as an English typer can easily provide the feedback that the Esc key is rarely used during regular editing. I am leaning towards Esc = abort/clear for single-line editing, but to ignore Esc during multi-line editing. However, it could be that Esc is pressed so often by IME users that this behavior would be annoying even when editing a short text field. Commented Mar 27 at 1:53

You should be worrying about that "Enter" key as well. Users hitting Enter while editing text is more common than Esc, and likely users will be hitting it for a line break not to save and close the editor.

I don't know about IME use much, but a Google suggests you're correct to believe IME users don't want Esc to cancel focus. https://forum.vivaldi.net/topic/28645/the-esc-key-when-using-ime https://github.com/mastodon/mastodon/issues/5574

Are you able to explore a draft or unsaved changes state similar to how Jira operates? If a user has entered a bunch of content into a field, and clicks or Esc's out of editing focus, the updated test isn't shown but isn't thrown away either. The user can click back into edit focus, see their changes, than click save b/c nothing was lost.

Either way, without further testing those 2 links suggest you should bind Esc to abort editing in your case.

  • Thanks for the link. The bug there is that Vivaldi should ignore an Esc during IME character selection, and only abort focus on a second press of Esc. I'll keep the question open in the hopes that someone can comment on how often it is that an IME user will press Esc twice accidentally, causing the focus to be unintentionally lost. Commented Apr 6 at 15:21

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.