Skip to content

Build your personal knowledge base with Trilium Notes

fix for dialog's focus stealing

azivner465c9e56ebd1
diff --git a/static/js/note.js b/static/js/note.js
index 3520254221..7532d7f9d8 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 {