Commit a7ea0e6b authored by Phil Hughes's avatar Phil Hughes

changed what bit of code stops the callback

parent ca6e2a45
...@@ -44,9 +44,7 @@ export default { ...@@ -44,9 +44,7 @@ export default {
e.preventDefault(); e.preventDefault();
} }
if (!e.target.classList.contains('inputarea')) {
this.toggleFileFinder(!this.fileFindVisible); this.toggleFileFinder(!this.fileFindVisible);
}
}); });
Mousetrap.stopCallback = (e, el, combo) => this.mousetrapStopCallback(e, el, combo); Mousetrap.stopCallback = (e, el, combo) => this.mousetrapStopCallback(e, el, combo);
...@@ -54,7 +52,10 @@ export default { ...@@ -54,7 +52,10 @@ export default {
methods: { methods: {
...mapActions(['toggleFileFinder']), ...mapActions(['toggleFileFinder']),
mousetrapStopCallback(e, el, combo) { mousetrapStopCallback(e, el, combo) {
if (combo === 't' && el.classList.contains('dropdown-input-field')) { if (
(combo === 't' && el.classList.contains('dropdown-input-field')) ||
el.classList.contains('inputarea')
) {
return true; return true;
} else if (combo === 'command+p' || combo === 'ctrl+p') { } else if (combo === 'command+p' || combo === 'ctrl+p') {
return false; return false;
......
...@@ -107,5 +107,11 @@ describe('ide component', () => { ...@@ -107,5 +107,11 @@ describe('ide component', () => {
vm.mousetrapStopCallback(null, vm.$el.querySelector('.dropdown-input-field'), 't'), vm.mousetrapStopCallback(null, vm.$el.querySelector('.dropdown-input-field'), 't'),
).toBe(true); ).toBe(true);
}); });
it('stops callback in monaco editor', () => {
setFixtures('<div class="inputarea"></div>');
expect(vm.mousetrapStopCallback(null, document.querySelector('.inputarea'), 't')).toBe(true);
});
}); });
}); });
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