From 725e578b4655f94363cf49350aadb2b0bead4f39 Mon Sep 17 00:00:00 2001 From: lukas Date: Fri, 19 Sep 2025 13:57:50 +0200 Subject: [PATCH] fix: empty component children handling --- src/unfold/templatetags/unfold.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/unfold/templatetags/unfold.py b/src/unfold/templatetags/unfold.py index b6a75c638..57dc6868b 100644 --- a/src/unfold/templatetags/unfold.py +++ b/src/unfold/templatetags/unfold.py @@ -244,7 +244,14 @@ def render(self, context: RequestContext) -> str: context_copy = context.new() context_copy.update(context.flatten()) context_copy.update(values) - values.update({"children": self.nodelist.render(context_copy)}) + children = self.nodelist.render(context_copy) + + if len(children) > 0: + values.update( + { + "children": children, + } + ) if self.include_context: values.update(context.flatten())