eventsescapingfieldjira

Jira escape button behaviour


I am currently working with Jira and stumbled on a problem. If on the browse page of an issue and editing a textfield, pressing escape discards all changes. Doing the same editing a comment field, doesn't discard changes on the comment. What I really want is that changes will be saved when pressing escape and losing focus on editing the field content. The same that happens if you click in an empty area.

Of course I am not the only one searching for a solution to this problem:

https://jira.atlassian.com/browse/JRA-36670

https://jira.atlassian.com/browse/JRA-41814

Now I am not here to discuss the meaning of the escape button. There are several reasons for the behaviour i wish (start with reading the comments on the first link).

Is there any way to edit Keyevent handling of jira? Or overwrite event behaviour of standard fields? Adding events via browser plugins or similar doesn't help as the content is already lost then.

I hope there is some elegant solution out there as I am not the only searching for one. Any suggestions?


Solution

  • Athlassian really did it with the Esc-behavior. It costs people nerves and money. Esc shouldn't save anything IMHO but it should at least offer you the possibility of retreiving the lost work. Jira-Description might get realy big and if you don't save you lose your temper and resources.

    There is a nice workaround though. I found it in Jira-Development Jira :)

    The workaround:

    1. Install this extension
    2. Open any of your JIRA pages, click the "CJS" icon in the toolbar
    3. Paste this snippet

      document.addEventListener("keydown",function(e) { var charCode = e.charCode || e.keyCode || e.which; if (charCode == 27) { alert("Please do not press escape.") } }); document.addEventListener("keyup",function(e){ var charCode = e.charCode || e.keyCode || e.which; if (charCode == 27){ alert("Please do not press escape.") } });

    Now you will get an alert every time the escape key is pressed and the content will be preserved.