diff --git a/web/pgadmin/browser/static/js/panel.js b/web/pgadmin/browser/static/js/panel.js
index c0371b2dc..c9e64132b 100644
--- a/web/pgadmin/browser/static/js/panel.js
+++ b/web/pgadmin/browser/static/js/panel.js
@@ -98,11 +98,7 @@ define(
               }
 
               // Prevent browser from opening the drag file.
-              $('.pg-panel-content').bind('dragover', function (event) {
-                event.stopPropagation();
-                event.preventDefault();
-              });
-              $('.pg-panel-content').bind('drop', function (event) {
+              $container.bind('dragover drop', function (event) {
                 event.stopPropagation();
                 event.preventDefault();
               });
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 1ef690e55..e99db6955 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -492,11 +492,7 @@ define('tools.querytool', [
       });
 
       // Prevent browser from opening the drag file.
-      $('#datagrid').bind('dragover', function (event) {
-        event.stopPropagation();
-        event.preventDefault();
-      });
-      $('#datagrid').bind('drop', function (event) {
+      $('#datagrid').bind('dragover drop', function (event) {
         event.stopPropagation();
         event.preventDefault();
       });
