From 9d7f4e94b5e57df8e74bdfc4606f2d82e30e1724 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 20 Aug 2012 17:39:33 -0700 Subject: [PATCH] IE triggers keyPress for Esc. We should not delete selected text when this keyPress happens. Change-Id: I8028ba960d7e7ea15e56701850cd214bacc6a232 --- modules/ve/ce/ve.ce.Surface.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js index 29d227ef24..88943ce8cd 100644 --- a/modules/ve/ce/ve.ce.Surface.js +++ b/modules/ve/ce/ve.ce.Surface.js @@ -471,7 +471,8 @@ ve.ce.Surface.prototype.onKeyPress = function ( e ) { this.startPolling(); } - if ( selection.getLength() > 0 && e.which !== 0 ) { + // Is there an expanded range and something other than keycodes 0 (nothing) or 27 (esc) were pressed? + if ( selection.getLength() > 0 && ( e.which !== 0 || e.which !== 27 ) { this.stopPolling(); this.model.change( ve.dm.Transaction.newFromRemoval(