diff --git a/web/pgadmin/static/js/sqleditor/history/query_history.js b/web/pgadmin/static/js/sqleditor/history/query_history.js
index c171f7fb..76a7aca9 100644
--- a/web/pgadmin/static/js/sqleditor/history/query_history.js
+++ b/web/pgadmin/static/js/sqleditor/history/query_history.js
@@ -73,6 +73,8 @@ export default class QueryHistory {
         cursor: 'ew-resize',
       });
 
+      $histDetails.css('overflow', 'auto');
+
       this.queryHistDetails = new QueryHistoryDetails($histDetails);
       this.queryHistDetails.setEditorPref(this.editorPref);
       this.queryHistDetails.onCopyToEditorClick(this.onCopyToEditorHandler);
diff --git a/web/pgadmin/tools/sqleditor/static/scss/_history.scss b/web/pgadmin/tools/sqleditor/static/scss/_history.scss
index cbb7b029..fbb81782 100644
--- a/web/pgadmin/tools/sqleditor/static/scss/_history.scss
+++ b/web/pgadmin/tools/sqleditor/static/scss/_history.scss
@@ -88,7 +88,7 @@
 
 .sql-editor-history-container {
   height: 100%;
-  overflow: auto;
+  overflow: hidden;
   background-color: $negative-bg;
 }
 
@@ -97,6 +97,7 @@
   height: 100%;
   width: 100%;
   min-height: 19em;
+  overflow: auto;
   display: flex;
   flex-direction: column;
   background-color: $color-bg;
@@ -157,7 +158,7 @@
     flex: 5;
     margin-left: 10px;
     margin-right: 10px;
-    min-height: 1em;
+    min-height: 4em;
     position: relative;
 
     .copy-all, .was-copied, .copy-to-editor {
