浏览代码

fixes #4578 - correct the way dim_props created (#4587)

Kanva Bhatia 4 月之前
父节点
当前提交
ab4e05be34
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      reflex/components/recharts/charts.py

+ 2 - 2
reflex/components/recharts/charts.py

@@ -85,8 +85,8 @@ class ChartBase(RechartsCharts):
         cls._ensure_valid_dimension("height", height)
         cls._ensure_valid_dimension("height", height)
 
 
         dim_props = {
         dim_props = {
-            "width": width or "100%",
-            "height": height or "100%",
+            "width": width if width is not None else "100%",
+            "height": height if height is not None else "100%",
         }
         }
         # Provide min dimensions so the graph always appears, even if the outer container is zero-size.
         # Provide min dimensions so the graph always appears, even if the outer container is zero-size.
         if width is None:
         if width is None: