diff --git a/.changeset/chilly-dragons-smoke.md b/.changeset/chilly-dragons-smoke.md new file mode 100644 index 0000000000000..7df9c33aedbdf --- /dev/null +++ b/.changeset/chilly-dragons-smoke.md @@ -0,0 +1,7 @@ +--- +"@gradio/column": minor +"@gradio/row": minor +"gradio": minor +--- + +feat:Equal height columns diff --git a/gradio/layouts/form.py b/gradio/layouts/form.py index e16283686ff23..fc260c007acbb 100644 --- a/gradio/layouts/form.py +++ b/gradio/layouts/form.py @@ -4,6 +4,7 @@ from gradio.blocks import BlockContext, Blocks from gradio.component_meta import ComponentMeta +from gradio.layouts.column import Column from gradio.layouts.row import Row if TYPE_CHECKING: @@ -38,6 +39,13 @@ def add_child(self, child: Block): scale = getattr(child, "scale", None) self.scale += 1 if scale is None else scale self.min_width += getattr(child, "min_width", 0) or 0 + elif ( + isinstance(self.parent, Column) + and isinstance(self.parent.parent, Row) + and self.parent.parent.equal_height + ): + scale = getattr(child, "scale", None) + self.scale += 1 if scale is None else scale elif isinstance(self.parent, Blocks) and self.parent.fill_height: scale = getattr(child, "scale", None) self.scale += 0 if scale is None else scale diff --git a/js/column/Index.svelte b/js/column/Index.svelte index 67cc50cbaaee8..e74f08da72fc9 100644 --- a/js/column/Index.svelte +++ b/js/column/Index.svelte @@ -17,7 +17,7 @@