From 15bec864333e5aeb9661de8e77f32aebafe52a30 Mon Sep 17 00:00:00 2001 From: petetnt Date: Thu, 22 Sep 2016 21:18:07 +0300 Subject: [PATCH] Don't let ESC key bubble in CodeHintList. Fixes #12799 Signed-off-by: petetnt --- src/editor/CodeHintList.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/editor/CodeHintList.js b/src/editor/CodeHintList.js index 1c672d44925..0af254dafd7 100644 --- a/src/editor/CodeHintList.js +++ b/src/editor/CodeHintList.js @@ -392,14 +392,17 @@ define(function (require, exports, module) { if (event.type === "keydown" && this.isHandlingKeyCode(event)) { keyCode = event.keyCode; - if (event.keyCode === KeyEvent.DOM_VK_ESCAPE || - (event.shiftKey && + if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) { + event.stopImmediatePropagation(); + this.handleClose(); + + return false; + } else if (event.shiftKey && (event.keyCode === KeyEvent.DOM_VK_UP || event.keyCode === KeyEvent.DOM_VK_DOWN || event.keyCode === KeyEvent.DOM_VK_PAGE_UP || - event.keyCode === KeyEvent.DOM_VK_PAGE_DOWN))) { + event.keyCode === KeyEvent.DOM_VK_PAGE_DOWN)) { this.handleClose(); - // Let the event bubble. return false; } else if (keyCode === KeyEvent.DOM_VK_UP) {