Skip to content

Commit 61215a5

Browse files
committed
Add some commentary about needing to identify an output context
1 parent 7c29101 commit 61215a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shinywidgets/_shinywidgets.py

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ def _cleanup_session_state():
128128
)
129129

130130
# If we're in a reactive context, close this widget when the context is invalidated
131+
# TODO: this should probably only be done in an output context, but I'm pretty sure
132+
# we don't have a decent way to determine that at the moment. In theory, doing this
133+
# in _any_ reactive context be problematic if you have an effect() that adds one
134+
# widget to another (i.e., a marker to a map) and want that marker to persist through
135+
# the next invalidation. The example provided in #174 is one such example.
131136
if has_current_context():
132137
ctx = get_current_context()
133138

0 commit comments

Comments
 (0)