Browse Source

add dependency for useMemo for layout

namnguyen 9 months ago
parent
commit
55d9068275
1 changed files with 12 additions and 1 deletions
  1. 12 1
      frontend/taipy-gui/src/components/Taipy/Metric.tsx

+ 12 - 1
frontend/taipy-gui/src/components/Taipy/Metric.tsx

@@ -182,7 +182,18 @@ const Metric = (props: MetricProps) => {
         }
 
         return layout as Partial<Layout>;
-    }, [props.title, props.template, props.template_Dark_, props.template_Light_, theme.palette.mode, baseLayout]);
+    }, [
+        props.title,
+        props.height,
+        props.width,
+        baseLayout.height,
+        baseLayout.width,
+        props.template,
+        props.template_Dark_,
+        props.template_Light_,
+        theme.palette.mode,
+        baseLayout,
+    ]);
 
     return (
         <Tooltip title={hover || ""}>