Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed global-search keyboard shortcut for non-english keyboard layouts. #10714

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions ui/app/components/global-search/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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();
}
Expand Down
6 changes: 2 additions & 4 deletions ui/tests/acceptance/search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down