From 465c9e56ebd1eaf5e37c43372a5ee27a9de7e68c Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 5 Sep 2017 23:56:39 -0400 Subject: [PATCH] fix for dialog's focus stealing --- static/js/note.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/note.js b/static/js/note.js index 352025422..7532d7f9d 100644 --- a/static/js/note.js +++ b/static/js/note.js @@ -166,7 +166,13 @@ function handleEncryption(requireEncryption, modal, callback) { $("#encryptionPasswordDialog").dialog({ modal: modal, - width: 400 + width: 400, + open: function() { + if (!modal) { + // dialog steals focus for itself, which is not what we want for non-modal (viewing) + getNodeByKey(globalNote.detail.note_id).setFocus(); + } + } }); } else {