浏览代码

add dependency for useMemo for layout

namnguyen 9 月之前
父节点
当前提交
55d9068275
共有 1 个文件被更改,包括 12 次插入1 次删除
  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 || ""}>