Skip to content

Commit 234c666

Browse files
committed
Properly cleanup when the Widget is initialized by an implicit as_widget() call
1 parent 03ed44c commit 234c666

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shinywidgets/_render_widget_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def __init__(
7171

7272
async def render(self) -> Jsonifiable | None:
7373
with WidgetRenderContext(self.output_id):
74-
value = await self.fn()
74+
return await self._render()
75+
76+
async def _render(self) -> Jsonifiable | None:
77+
value = await self.fn()
7578

7679
# Attach value/widget attributes to user func so they can be accessed (in other reactive contexts)
7780
self._value = value

0 commit comments

Comments
 (0)