Commit f8cf223c authored by Mike Greiling's avatar Mike Greiling

Merge branch 'nfriend-dont-apply-ctrl-p-on-mac' into 'master'

Don't apply Ctrl+P MR keyboard shortcut on Mac

See merge request gitlab-org/gitlab!42240
parents 40c6f109 6f0e5ed6
......@@ -128,7 +128,7 @@ export default {
this.focusedIndex = 0;
}
Mousetrap.bind(['t', 'command+p', 'ctrl+p'], e => {
Mousetrap.bind(['t', 'mod+p'], e => {
if (e.preventDefault) {
e.preventDefault();
}
......@@ -142,7 +142,7 @@ export default {
el.classList.contains('inputarea')
) {
return true;
} else if (combo === 'command+p' || combo === 'ctrl+p') {
} else if (combo === 'mod+p') {
return false;
}
......
---
title: Stop applying Ctrl+P shortcut on MR page on Mac
merge_request: 42240
author:
type: fixed
......@@ -319,8 +319,8 @@ describe('File finder item spec', () => {
.catch(done.fail);
});
it('calls toggle on `command+p` key press', done => {
Mousetrap.trigger('command+p');
it('calls toggle on `mod+p` key press', done => {
Mousetrap.trigger('mod+p');
vm.$nextTick()
.then(() => {
......@@ -330,33 +330,12 @@ describe('File finder item spec', () => {
.catch(done.fail);
});
it('calls toggle on `ctrl+p` key press', done => {
Mousetrap.trigger('ctrl+p');
vm.$nextTick()
.then(() => {
expect(vm.toggle).toHaveBeenCalled();
})
.then(done)
.catch(done.fail);
});
it('always allows `command+p` to trigger toggle', () => {
expect(
Mousetrap.prototype.stopCallback(
null,
vm.$el.querySelector('.dropdown-input-field'),
'command+p',
),
).toBe(false);
});
it('always allows `ctrl+p` to trigger toggle', () => {
it('always allows `mod+p` to trigger toggle', () => {
expect(
Mousetrap.prototype.stopCallback(
null,
vm.$el.querySelector('.dropdown-input-field'),
'ctrl+p',
'mod+p',
),
).toBe(false);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment