#JC-1470 Fixed behavior for "Esc" and "Enter" buttons.