Skip to content

Commit

Permalink
Fix cleanup of children on ReactiveHTML (#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Dec 8, 2021
1 parent f5a099d commit 2dba064
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion panel/reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ def __init__(self, **params):
def _cleanup(self, root):
for child, panes in self._panes.items():
for pane in panes:
child._cleanup(root)
pane._cleanup(root)
super()._cleanup(root)

@property
Expand Down
4 changes: 4 additions & 0 deletions panel/tests/test_reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ class TestChildren(ReactiveHTML):
assert root.children == {'div': [widget_new._models[root.ref['id']][0]]}
assert test._panes == {'children': [widget_new]}

test._cleanup(root)
assert len(test._models) == 0
assert len(widget_new._models) == 0


def test_reactive_html_templated_children():

Expand Down

0 comments on commit 2dba064

Please sign in to comment.