[ARVADOS-WORKBENCH2] updated: 2.2.1-98-gd332a558
    Git user 
    git at public.arvados.org
       
    Thu Sep 30 15:06:59 UTC 2021
    
    
  
Summary of changes:
 .../loading-overlay/loading-overlay.tsx             | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
       via  d332a55872ab05bc5ce53c3e62f6e8102d573962 (commit)
      from  dd63617d23cd24703e9847a8971af8b069e3ce38 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d332a55872ab05bc5ce53c3e62f6e8102d573962
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date:   Thu Sep 30 17:06:20 2021 +0200
    16951: Blocked context menu when refreshing
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/src/views-components/loading-overlay/loading-overlay.tsx b/src/views-components/loading-overlay/loading-overlay.tsx
index cf3e8d1c..1b8f9360 100644
--- a/src/views-components/loading-overlay/loading-overlay.tsx
+++ b/src/views-components/loading-overlay/loading-overlay.tsx
@@ -20,11 +20,28 @@ type LoginFormProps = {
     children?: any,
 };
 
-const LoadingOverlay = ({ loading, children, classes }: LoginFormProps & WithStyles<CssRules>) => 
-    loading ? 
+const preventContextMenu = (event) => {
+    event.preventDefault();
+};
+
+const LoadingOverlay = ({ loading, children, classes }: LoginFormProps & WithStyles<CssRules>) => {
+    React.useEffect(() => {
+        if (loading) {
+            document.addEventListener("contextmenu", preventContextMenu);
+        } else {
+            document.removeEventListener("contextmenu", preventContextMenu);
+        }
+
+        // eslint-disable-next-line
+    }, [loading]);
+
+
+    return loading ?
         <div data-cy="loading-overlay" className={classes.overlay}>
             {children}
         </div> :
         children;
+}
+
 
 export default withStyles(styles)(LoadingOverlay);
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
-- 
    
    
More information about the arvados-commits
mailing list