Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13560 from adobe/petetnt/fix-ctrl-space
Browse files Browse the repository at this point in the history
Fix CTRL+Space handling while the CodeHintList is open, fixes #13481
  • Loading branch information
swmitra committed Jul 14, 2017
2 parents 1edb0d6 + 8bd7adb commit 1842ac2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/editor/CodeHintList.js
Expand Up @@ -326,8 +326,9 @@ define(function (require, exports, module) {
* Convert keydown events into hint list navigation actions.
*
* @param {KeyBoardEvent} keyEvent
* @param {bool} isFakeKeydown - True if faked key down call (for example calling CTRL+Space while hints are open)
*/
CodeHintList.prototype._keydownHook = function (event) {
CodeHintList.prototype._keydownHook = function (event, isFakeKeydown) {
var keyCode,
self = this;

Expand Down Expand Up @@ -389,13 +390,13 @@ define(function (require, exports, module) {
}

// (page) up, (page) down, enter and tab key are handled by the list
if (event.type === "keydown" && this.isHandlingKeyCode(event)) {
if ((event.type === "keydown" || isFakeKeydown) && this.isHandlingKeyCode(event)) {
keyCode = event.keyCode;

if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) {
event.stopImmediatePropagation();
this.handleClose();

return false;
} else if (event.shiftKey &&
(event.keyCode === KeyEvent.DOM_VK_UP ||
Expand Down Expand Up @@ -517,9 +518,7 @@ define(function (require, exports, module) {
* @param {KeyBoardEvent} keyEvent
*/
CodeHintList.prototype.callMoveUp = function (event) {
delete event.type;
event.type = "keydown";
this._keydownHook(event);
this._keydownHook(event, true);
};
/**
* Closes the hint list
Expand Down

0 comments on commit 1842ac2

Please sign in to comment.