diff --git a/.changelog/23365.txt b/.changelog/23365.txt new file mode 100644 index 00000000000..031263393b8 --- /dev/null +++ b/.changelog/23365.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Dont show keyboard nav hints when taking a screenshot +``` diff --git a/ui/app/services/keyboard.js b/ui/app/services/keyboard.js index b7d092b0346..3ed4f78fccf 100644 --- a/ui/app/services/keyboard.js +++ b/ui/app/services/keyboard.js @@ -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)) { diff --git a/ui/tests/acceptance/keyboard-test.js b/ui/tests/acceptance/keyboard-test.js index 77653e70877..339b21e04a9 100644 --- a/ui/tests/acceptance/keyboard-test.js +++ b/ui/tests/acceptance/keyboard-test.js @@ -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' }); }); });