Skip to content

Commit

Permalink
Consistenly report ESC key as "Escape", not "Esc".
Browse files Browse the repository at this point in the history
Fixes #439.
  • Loading branch information
wkeese committed Mar 10, 2016
1 parent 1a3b5b6 commit fc33d98
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion HasDropDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ define([
return;
}
}
if (dropDown && this.opened && e.key === "Esc") {
if (dropDown && this.opened && e.key === "Escape") {
this.closeDropDown();
e.stopPropagation();
e.preventDefault();
Expand Down
3 changes: 2 additions & 1 deletion on.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ define(function () {
"U+0020": "Spacebar",
"U+0008": "Backspace",
"U+0009": "Tab",
"U+001B": "Esc",
"U+001B": "Escape",

// fix for FF 34
" ": "Spacebar",
Expand All @@ -40,6 +40,7 @@ define(function () {
"Right": "ArrowRight",
"Up": "ArrowUp",
"Del": "Delete",
"Esc": "Escape",

// fix for Android 4.2
"U+00007F": "Backspace"
Expand Down
2 changes: 1 addition & 1 deletion popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ define([
// provide default escape and tab key handling
// (this will work for any widget, not just menu)
var onKeyDown = function (evt) {
if ((evt.key === "Esc" || evt.key === "Tab") && args.onCancel) {
if ((evt.key === "Escape" || evt.key === "Tab") && args.onCancel) {
evt.stopPropagation();
evt.preventDefault();
args.onCancel();
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/on.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ define([
})
.pressKeys(keys.ESCAPE)
.execute("return keydown_log.value;").then(function (log) {
assert.strictEqual(log, "Esc");
assert.strictEqual(log, "Escape");
})
.pressKeys(" ")
.execute("return keydown_log.value;").then(function (log) {
Expand Down

0 comments on commit fc33d98

Please sign in to comment.