Skip to content

Commit

Permalink
Ensure CompositeWidget can be populated in callback (#7636)
Browse files Browse the repository at this point in the history
philippjfr authored Jan 21, 2025
1 parent 838fcc3 commit 63bf7a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion panel/widgets/base.py
Original file line number Diff line number Diff line change
@@ -206,6 +206,7 @@ class CompositeWidget(Widget):
__abstract = True

def __init__(self, **params):
self._composite = self._composite_type()
super().__init__(**params)
layout_params = [p for p in Layoutable.param if p != 'name']
layout = {p: getattr(self, p) for p in layout_params
@@ -216,7 +217,7 @@ def __init__(self, **params):
min_width = layout.pop('width')
if not layout.get('min_width'):
layout['min_width'] = min_width
self._composite = self._composite_type(**layout)
self._composite.param.update(**layout)
self._models = self._composite._models
self._internal_callbacks.append(
self.param.watch(self._update_layout_params, layout_params)

0 comments on commit 63bf7a6

Please sign in to comment.