mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] Dont show keyboard hints when a user is trying to take a screenshot (#23365)
* Dont show keyboard hints when a user is trying to take a screenshot * Oh hey metaKey is its own special thing
This commit is contained in:
3
.changelog/23365.txt
Normal file
3
.changelog/23365.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Dont show keyboard nav hints when taking a screenshot
|
||||
```
|
||||
@@ -348,6 +348,10 @@ export default class KeyboardService extends Service {
|
||||
const shifted = event.getModifierState('Shift');
|
||||
if (type === 'press') {
|
||||
if (key === 'Shift') {
|
||||
// if cmd/windows key is pressed, don't show hints — this is likely a user trying to take a screenshot.
|
||||
if (event.getModifierState('Meta')) {
|
||||
return;
|
||||
}
|
||||
this.displayHints = true;
|
||||
} else {
|
||||
if (!DISALLOWED_KEYS.includes(key)) {
|
||||
|
||||
@@ -270,6 +270,18 @@ module('Acceptance | keyboard', function (hooks) {
|
||||
0,
|
||||
'Hints disappear when you release Shift'
|
||||
);
|
||||
|
||||
await triggerEvent('.page-layout', 'keydown', {
|
||||
key: 'Shift',
|
||||
metaKey: true,
|
||||
});
|
||||
assert.equal(
|
||||
document.querySelectorAll('[data-test-keyboard-hint]').length,
|
||||
0,
|
||||
'Hints do not show up when holding down Command+Shift'
|
||||
);
|
||||
await triggerEvent('.page-layout', 'keyup', { key: 'Shift' });
|
||||
await triggerEvent('.page-layout', 'keyup', { key: 'Meta' });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user