diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index 96ca1f9f48..1d56e7c843 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -1019,7 +1019,8 @@ window.commentReply = { } setTimeout(function() { - var rtop, rbottom, scrollTop, vp, scrollBottom; + var rtop, rbottom, scrollTop, vp, scrollBottom, + isComposing = false; rtop = $('#replyrow').offset().top; rbottom = rtop + $('#replyrow').height(); @@ -1032,10 +1033,17 @@ window.commentReply = { else if ( rtop - 20 < scrollTop ) window.scroll(0, rtop - 35); - $('#replycontent').trigger( 'focus' ).on( 'keyup', function(e){ - if ( e.which == 27 ) - commentReply.revert(); // Close on Escape. - }); + $( '#replycontent' ) + .trigger( 'focus' ) + .on( 'keyup', function( e ) { + // Close on Escape except when Input Method Editors (IMEs) are in use. + if ( e.which === 27 && ! isComposing ) { + commentReply.revert(); + } + } ) + .on( 'compositionstart', function() { + isComposing = true; + } ); }, 600); return false; diff --git a/wp-admin/js/edit-comments.min.js b/wp-admin/js/edit-comments.min.js index 9f2b049a9e..ca01a49e5b 100644 --- a/wp-admin/js/edit-comments.min.js +++ b/wp-admin/js/edit-comments.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(w){var o,s,i=document.title,C=w("#dashboard_right_now").length,c=wp.i18n.__,x=function(t){t=parseInt(t.html().replace(/[^0-9]+/g,""),10);return isNaN(t)?0:t},r=function(t,e){var n="";if(!isNaN(e)){if(3<(e=e<1?"0":e.toString()).length){for(;3"),e=i,1<=(t=(a=s.exec(document.title))?(a=a[0],o.html(a),x(o)+t):(o.html(0),t))?(r(o,t),(n=s.exec(document.title))&&(e=document.title.replace(n[0],c("Comments (%s)").replace("%s",o.text())+" "))):(n=s.exec(e))&&(e=e.replace(n[0],c("Comments"))),document.title=e},I=function(n,t){var e=".post-com-count-"+t,a="comment-count-no-pending",o="post-com-count-no-pending",s="comment-count-pending";C||l(n),w("span.pending-count").each(function(){var t=w(this),e=x(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0===e?"addClass":"removeClass"]("count-0"),r(t,e)}),t&&(t=w("span."+s,e),e=w("span."+a,e),t.each(function(){var t=w(this),e=x(t)+n;0===(e=e<1?0:e)?(t.parent().addClass(o),t.removeClass(s).addClass(a)):(t.parent().removeClass(o),t.addClass(s).removeClass(a)),r(t,e)}),e.each(function(){var t=w(this);0