diff --git a/app/scripts/auto-type/index.js b/app/scripts/auto-type/index.js index c5e9fafd..c2cd02ec 100644 --- a/app/scripts/auto-type/index.js +++ b/app/scripts/auto-type/index.js @@ -254,7 +254,6 @@ const AutoType = { Events.emit('open-file'); Events.once('closed-open-view', () => { this.selectEntryView.show(); - this.selectEntryView.setupKeys(); }); }); }, diff --git a/app/scripts/comp/browser/key-handler.js b/app/scripts/comp/browser/key-handler.js index b41166d9..5a821a36 100644 --- a/app/scripts/comp/browser/key-handler.js +++ b/app/scripts/comp/browser/key-handler.js @@ -63,7 +63,7 @@ class KeyHandler { const keyShortcuts = this.shortcuts[code]; if (keyShortcuts && keyShortcuts.length) { for (const sh of keyShortcuts) { - if (this.modal && sh.modal !== this.modal) { + if (this.modal && (sh.modal !== this.modal || sh.modal === '*')) { e.stopPropagation(); continue; } diff --git a/app/scripts/views/app-view.js b/app/scripts/views/app-view.js index 8bc7eff5..7af5bbd9 100644 --- a/app/scripts/views/app-view.js +++ b/app/scripts/views/app-view.js @@ -103,7 +103,8 @@ class AppView extends View { this.onKey( Keys.DOM_VK_I, this.openDevTools, - KeyHandler.SHORTCUT_ACTION + KeyHandler.SHORTCUT_OPT + KeyHandler.SHORTCUT_ACTION + KeyHandler.SHORTCUT_OPT, + '*' ); } diff --git a/app/scripts/views/auto-type/auto-type-select-view.js b/app/scripts/views/auto-type/auto-type-select-view.js index 077b8a06..21418b67 100644 --- a/app/scripts/views/auto-type/auto-type-select-view.js +++ b/app/scripts/views/auto-type/auto-type-select-view.js @@ -61,6 +61,12 @@ class AutoTypeSelectView extends View { this.once('remove', () => { KeyHandler.setModal(null); }); + this.on('show', () => { + KeyHandler.setModal('auto-type'); + }); + this.on('hide', () => { + KeyHandler.setModal(null); + }); } render() { diff --git a/app/scripts/views/modal-view.js b/app/scripts/views/modal-view.js index c1cddfad..829d7826 100644 --- a/app/scripts/views/modal-view.js +++ b/app/scripts/views/modal-view.js @@ -21,9 +21,10 @@ class ModalView extends View { if (typeof this.model.enter === 'string') { this.onKey(Keys.DOM_VK_RETURN, this.enterPressed, false, 'alert'); } + const prevModal = KeyHandler.modal; KeyHandler.setModal('alert'); this.once('remove', () => { - KeyHandler.setModal(null); + KeyHandler.setModal(prevModal); if (this.model.view) { this.model.view.remove(); } diff --git a/app/scripts/views/open-view.js b/app/scripts/views/open-view.js index 1b28b8a7..93caccb7 100644 --- a/app/scripts/views/open-view.js +++ b/app/scripts/views/open-view.js @@ -60,15 +60,17 @@ class OpenView extends View { super(model); this.resetParams(); this.passwordInput = new SecureInput(); - this.onKey(Keys.DOM_VK_Z, this.undoKeyPress, KeyHandler.SHORTCUT_ACTION); - this.onKey(Keys.DOM_VK_TAB, this.tabKeyPress); - this.onKey(Keys.DOM_VK_ENTER, this.enterKeyPress); - this.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress); - this.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown); - this.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp); + this.onKey(Keys.DOM_VK_Z, this.undoKeyPress, KeyHandler.SHORTCUT_ACTION, 'open'); + this.onKey(Keys.DOM_VK_TAB, this.tabKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_ENTER, this.enterKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress, null, 'open'); + this.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown, null, 'open'); + this.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp, null, 'open'); this.listenTo(Events, 'main-window-focus', this.windowFocused.bind(this)); + KeyHandler.setModal('open'); this.once('remove', () => { this.passwordInput.reset(); + KeyHandler.setModal(null); }); } diff --git a/release-notes.md b/release-notes.md index 7bf1980e..64f66c1b 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,6 +2,7 @@ Release notes ------------- ##### v1.11.7 (2019-10-08) `-` fix #1289: crash on Auto sorting mode +`-` fix #1288: issues when opening a file during in auto-type mode ##### v1.11.6 (2019-10-04) `-` fix #1285: issues in moving entries across files