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

Commit

Permalink
Fix QuickOpen unit tests after introduction of QuickSearchField - lis…
Browse files Browse the repository at this point in the history
…tens

for Enter on keydown, not keyup; expects an "input" event to follow every
text change (Enter key processing now waits until text change events have
caught up so Enter key never takes effect if change event never comes)
  • Loading branch information
peterflynn committed Apr 17, 2015
1 parent 6345cf1 commit 053f7c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/widgets/ModalBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ define(function (require, exports, module) {
};

/**
* If autoClose is set, handles the RETURN/ESC keys in the input field.
* If autoClose is set, close the bar when Escape is pressed
*/
ModalBar.prototype._handleKeydown = function (e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
Expand Down
3 changes: 2 additions & 1 deletion test/spec/QuickOpen-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ define(function (require, exports, module) {

testWindow.setTimeout(function () {
getSearchField().val(str);
getSearchField().trigger("input");
}, timeoutLength);
}

Expand All @@ -88,7 +89,7 @@ define(function (require, exports, module) {

// Using keyup here because of inside knowledge of how the events are processed
// on the QuickOpen input.
SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keyup", getSearchField()[0]);
SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", getSearchField()[0]);
}

/**
Expand Down

0 comments on commit 053f7c9

Please sign in to comment.