diff --git a/src/app/commoncomponents/BaseModalDialog.qml b/src/app/commoncomponents/BaseModalDialog.qml
index 0fdc3ff71ca9066a321eadd795719fa96267a34b..2ee3de52ace1e982946af0f71584ec3d07d00bd9 100644
--- a/src/app/commoncomponents/BaseModalDialog.qml
+++ b/src/app/commoncomponents/BaseModalDialog.qml
@@ -47,6 +47,7 @@ Popup {
 
     // A popup is invisible until opened.
     visible: false
+    focus: true
     closePolicy: autoClose ? (Popup.CloseOnEscape | Popup.CloseOnPressOutside) : Popup.NoAutoClose
 
     Rectangle {
diff --git a/src/app/commoncomponents/EmojiReactionPopup.qml b/src/app/commoncomponents/EmojiReactionPopup.qml
index cc2dfbb3fbe2a63c6885efb805ec9028ad583ddc..2358870a22cc7c44c0ea910354dbba1e6567fe5d 100644
--- a/src/app/commoncomponents/EmojiReactionPopup.qml
+++ b/src/app/commoncomponents/EmojiReactionPopup.qml
@@ -42,6 +42,7 @@ Popup {
     padding: 0
 
     visible: false
+    focus: true
     closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
 
     Rectangle {
diff --git a/src/app/commoncomponents/MarkdownPopup.qml b/src/app/commoncomponents/MarkdownPopup.qml
index 0423571e5dc472875e997ac1aeb99ffc0bda8ebd..67c7273717bb6bda55d1cc310d24f52fe88350b5 100644
--- a/src/app/commoncomponents/MarkdownPopup.qml
+++ b/src/app/commoncomponents/MarkdownPopup.qml
@@ -30,6 +30,9 @@ Popup {
     padding: 0
     property list<Action> menuTypoActionsSecond
 
+    focus: true
+    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+
     contentItem: ListView {
         id: listViewTypoSecond
 
diff --git a/src/app/commoncomponents/MessageOptionsPopup.qml b/src/app/commoncomponents/MessageOptionsPopup.qml
index 9a32d41a5e19b69a64f2f2a8f4541f15829f7717..e359bc1968e02cb35d4cab8c92f4a765acd344d9 100644
--- a/src/app/commoncomponents/MessageOptionsPopup.qml
+++ b/src/app/commoncomponents/MessageOptionsPopup.qml
@@ -49,6 +49,9 @@ Popup {
     property bool closeWithoutAnimation: false
     property var emojiPicker
 
+    focus: true
+    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+
     function xPositionProvider(width) {
         // Use the width at function scope to retrigger property evaluation.
         const listViewWidth = listView.width
diff --git a/src/app/mainview/MainView.qml b/src/app/mainview/MainView.qml
index 6735e2b09167c6f36451759b68d6555d3d5d08c5..cd7c5a21157906e5c7bcc33684008968b7c28ee6 100644
--- a/src/app/mainview/MainView.qml
+++ b/src/app/mainview/MainView.qml
@@ -149,13 +149,12 @@ Rectangle {
         onActivated: layoutManager.toggleWindowFullScreen()
     }
 
-    Shortcut {
-        sequence: "Escape"
-        context: Qt.ApplicationShortcut
-        onActivated: {
-            MessagesAdapter.replyToId = ""
-            MessagesAdapter.editId = ""
-            layoutManager.popFullScreenItem()
+    Keys.onPressed: function (keyEvent) {
+        if (keyEvent.key === Qt.Key_Escape) {
+            MessagesAdapter.replyToId = "";
+            MessagesAdapter.editId = "";
+            layoutManager.popFullScreenItem();
+            keyEvent.accepted = true;
         }
     }
 
diff --git a/src/app/mainview/components/AccountComboBoxPopup.qml b/src/app/mainview/components/AccountComboBoxPopup.qml
index 1328e59ed7afbe3e72ee5724fa341c9782435579..c9dac291ef49c21c5ddd633f3e15c50461a00861 100644
--- a/src/app/mainview/components/AccountComboBoxPopup.qml
+++ b/src/app/mainview/components/AccountComboBoxPopup.qml
@@ -40,6 +40,9 @@ Popup {
         color: JamiTheme.transparentColor
     }
 
+    focus: true
+    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+
     contentItem: ColumnLayout {
         spacing: 0
 
diff --git a/src/app/mainview/components/ChatViewFooter.qml b/src/app/mainview/components/ChatViewFooter.qml
index a15ef68a5f7b776b0893a9b85263b91169d78990..c37ac3a99f9d80d8e68369bdb3b8e5d33e8e3dae 100644
--- a/src/app/mainview/components/ChatViewFooter.qml
+++ b/src/app/mainview/components/ChatViewFooter.qml
@@ -220,10 +220,7 @@ Rectangle {
 
             Keys.onShortcutOverride: function (keyEvent) {
                 if (keyEvent.key === Qt.Key_Escape) {
-                    if (emojiPicker != null && emojiPicker.opened) {
-                        emojiPicker.closeEmojiPicker();
-                    }
-                    else if (recordBox != null && recordBox.opened) {
+                    if (recordBox != null && recordBox.opened) {
                         recordBox.closeRecorder();
                     }
                     else if (PositionManager.isMapActive(CurrentAccount.id)){
diff --git a/src/app/mainview/components/RecordBox.qml b/src/app/mainview/components/RecordBox.qml
index 1e1aca66802f0798977304fd903dea7773c2e509..c7cb036008d3e9d3c6f4dc6985dc7350e6bfdd7f 100644
--- a/src/app/mainview/components/RecordBox.qml
+++ b/src/app/mainview/components/RecordBox.qml
@@ -51,6 +51,9 @@ Popup {
 
     signal validatePhoto(string photo)
 
+    modal: true
+    closePolicy: Popup.CloseOnPressOutsideParent
+
     function openRecorder(vid) {
         isVideo = vid;
         updateState(RecordBox.States.INIT);
@@ -121,9 +124,6 @@ Popup {
         time.text = min + ":" + sec;
     }
 
-    modal: true
-    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
-
     onActiveFocusChanged: {
         if (visible) {
             closeRecorder();
diff --git a/src/app/webengine/emojipicker/EmojiPicker.qml b/src/app/webengine/emojipicker/EmojiPicker.qml
index c268e36069b44e7e73e96cd4c0662e654c85c1d0..e3f3cf6d770ff09489d55607b5693b96b10c8fcc 100644
--- a/src/app/webengine/emojipicker/EmojiPicker.qml
+++ b/src/app/webengine/emojipicker/EmojiPicker.qml
@@ -32,6 +32,9 @@ Popup {
     required property ListView listView
     signal emojiIsPicked(string content)
 
+    focus: true
+    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
+
     // Close the picker when attached to a listView that receives height/scroll
     // property changes.
     property real listViewHeight: listView ? listView.height : 0
diff --git a/src/app/webengine/map/StopSharingPositionPopup.qml b/src/app/webengine/map/StopSharingPositionPopup.qml
index 81c9e205d19ad0c197547235c748ed4e147b6447..153d81efcba9effdcc5f403579bcab4714de3f68 100644
--- a/src/app/webengine/map/StopSharingPositionPopup.qml
+++ b/src/app/webengine/map/StopSharingPositionPopup.qml
@@ -42,6 +42,7 @@ Popup {
     padding: 0
 
     visible: false
+    focus: true
     closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
     Rectangle {
         id: container
diff --git a/src/app/wizardview/components/NoUsernamePopup.qml b/src/app/wizardview/components/NoUsernamePopup.qml
index 3fa1bf261e6ac716630e002a0b6579c3ea752bd9..4bf79a2c7dcf0ebd9d70cf2548698bef43dc992c 100644
--- a/src/app/wizardview/components/NoUsernamePopup.qml
+++ b/src/app/wizardview/components/NoUsernamePopup.qml
@@ -42,6 +42,7 @@ Popup {
     padding: 0
 
     visible: false
+    focus: true
     closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
 
     Rectangle {