From effbd91b7748ef1a4975359fc374cbd900db8c13 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 30 Mar 2015 12:03:03 -0700 Subject: [PATCH] directly blur codemirror to trigger command-mode rather than focusing the cell, which implies codemirror blur --- IPython/html/static/notebook/js/notebook.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 3e40ceb28..bc33c9817 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -663,10 +663,9 @@ define(function (require) { Notebook.prototype.command_mode = function () { var cell = this.get_cell(this.get_edit_index()); if (cell && this.mode !== 'command') { - // We don't call cell.command_mode, but rather call cell.focus_cell() - // which will blur and CM editor and trigger the call to - // handle_command_mode. - cell.focus_cell(); + // We don't call cell.command_mode, but rather blur the CM editor + // which will trigger the call to handle_command_mode. + cell.code_mirror.getInputField().blur(); } };