diff --git a/js/makegrid.js b/js/makegrid.js index 06a83f7734..dadd678aae 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -1253,10 +1253,7 @@ } }); $(g.cEdit).keydown(function(e) { - if (e.which == 27) { - // cancel on pressing "Esc" - g.hideEditCell(true); - } else if (!g.isEditCellTextEditable) { + if (!g.isEditCellTextEditable) { // prevent text editing e.preventDefault(); } @@ -1267,6 +1264,12 @@ g.hideEditCell(); } }); + $('html').keydown(function(e) { + if (e.which == 27 && g.isCellEditActive) { + // cancel on pressing "Esc" + g.hideEditCell(true); + } + }); // add table class $(t).addClass('pma_table');