diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eef86ca8cb2..90298bc3661e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ BUG FIXES: * drivers/exec: Fixed a bug where `exec` and `java` tasks inherit the Nomad agent's `oom_score_adj` value [[GH-10698](https://github.com/hashicorp/nomad/issues/10698)] * quotas (Enterprise): Fixed a bug where stopped allocations for a failed deployment can be double-credited to quota limits, resulting in a quota limit bypass. [[GH-10694](https://github.com/hashicorp/nomad/issues/10694)] * ui: Fixed a bug where exec would not work across regions. [[GH-10539](https://github.com/hashicorp/nomad/issues/10539)] +* ui: Fixed global-search shortcut for non-english keyboards. [[GH-10714](https://github.com/hashicorp/nomad/issues/10714)] ## 1.1.0 (May 18, 2021) diff --git a/ui/app/components/global-search/control.js b/ui/app/components/global-search/control.js index 84bc9a2bfff3..d61232e14a0e 100644 --- a/ui/app/components/global-search/control.js +++ b/ui/app/components/global-search/control.js @@ -5,7 +5,7 @@ import { action, set } from '@ember/object'; import { inject as service } from '@ember/service'; import { debounce, run } from '@ember/runloop'; -const SLASH_KEY = 191; +const SLASH_KEY = '/'; const MAXIMUM_RESULTS = 10; @classNames('global-search-container') @@ -24,7 +24,7 @@ export default class GlobalSearchControl extends Component { const targetElementName = e.target.nodeName.toLowerCase(); if (targetElementName != 'input' && targetElementName != 'textarea') { - if (e.keyCode === SLASH_KEY) { + if (e.key === SLASH_KEY) { e.preventDefault(); this.open(); } diff --git a/ui/tests/acceptance/search-test.js b/ui/tests/acceptance/search-test.js index 8045071ea03e..22cbe6a448ea 100644 --- a/ui/tests/acceptance/search-test.js +++ b/ui/tests/acceptance/search-test.js @@ -161,9 +161,7 @@ module('Acceptance | search', function(hooks) { assert.notOk(Layout.navbar.search.field.isPresent); - await triggerEvent('.page-layout', 'keydown', { - keyCode: 191, // slash - }); + await triggerEvent('.page-layout', 'keydown', { key: '/' }); assert.ok(Layout.navbar.search.field.isPresent); }); @@ -177,7 +175,7 @@ module('Acceptance | search', function(hooks) { assert.notOk(Layout.navbar.search.field.isPresent); await JobsList.search.click(); - await JobsList.search.keydown({ keyCode: 191 }); + await JobsList.search.keydown({ key: '/' }); assert.notOk(Layout.navbar.search.field.isPresent); });