diff --git a/resources/assets/javascripts/bootstrap/application.js b/resources/assets/javascripts/bootstrap/application.js
index 994171c093764d0d5e2bc9b2e56a534a3b14d2f5..f7fde4707007a59f2327864da8082ff86645a661 100644
--- a/resources/assets/javascripts/bootstrap/application.js
+++ b/resources/assets/javascripts/bootstrap/application.js
@@ -64,6 +64,11 @@ jQuery(document).on('click', '.messagebox .messagebox_buttons a', function () {
     return false;
 });
 
+STUDIP.ready(function() {
+    //Set the focus on the modal overlay dialog, if any:
+    $('.modaloverlay').find(':focusable').first().focus();
+});
+
 
 /* ------------------------------------------------------------------------
  * application wide setup
diff --git a/resources/assets/javascripts/lib/dialogs.js b/resources/assets/javascripts/lib/dialogs.js
index 371c9875505c02dcd47a69089583afdd5294748a..88d1f60818d633eea5dc2f96c997759f1ad59e8c 100644
--- a/resources/assets/javascripts/lib/dialogs.js
+++ b/resources/assets/javascripts/lib/dialogs.js
@@ -17,6 +17,9 @@ const Dialogs = {
             })
         );
 
+        //Set the focus inside the confirm dialog:
+        $(confirmDialog).find(':focusable').first().focus();
+
         return false;
     },