File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ def init_shiny_widget(w: Widget):
61
61
raise RuntimeError (
62
62
"shinywidgets requires that all ipywidgets be constructed within an active Shiny session"
63
63
)
64
+ # Break out of any module-specific session. Otherwise, input.shinywidgets_comm_send
65
+ # will be some module-specific copy.
66
+ while hasattr (session , "_parent" ):
67
+ session = session ._parent
64
68
65
69
# `Widget` has `comm = Instance('ipykernel.comm.Comm')` which means we'd get a
66
70
# runtime error if we try to set this attribute to a different class, but
@@ -123,9 +127,9 @@ def init_shiny_widget(w: Widget):
123
127
# Handle messages from the client. Note that widgets like qgrid send client->server messages
124
128
# to figure out things like what filter to be shown in the table.
125
129
@reactive .Effect
126
- @reactive .event (session .input [ " shinywidgets_comm_send" ] )
130
+ @reactive .event (session .input . shinywidgets_comm_send )
127
131
def _ ():
128
- msg_txt = session .input [ " shinywidgets_comm_send" ] ()
132
+ msg_txt = session .input . shinywidgets_comm_send ()
129
133
msg = json .loads (msg_txt )
130
134
comm_id = msg ["content" ]["comm_id" ]
131
135
comm : ShinyComm = COMM_MANAGER .comms [comm_id ]
You can’t perform that action at this time.
0 commit comments