@@ -846,7 +846,7 @@ def _insert_callback(self, output, inputs, state, prevent_initial_call):
846
846
return callback_id
847
847
848
848
def clientside_callback (
849
- self , clientside_function , output , inputs , state = (), prevent_initial_call = None
849
+ self , clientside_function , output , input , state = (), prevent_initial_call = None
850
850
):
851
851
"""Create a callback that updates the output by calling a clientside
852
852
(JavaScript) function instead of a Python function.
@@ -912,6 +912,9 @@ def clientside_callback(
912
912
not to fire when its outputs are first added to the page. Defaults to
913
913
`False` unless `prevent_initial_callbacks=True` at the app level.
914
914
"""
915
+ is_multi_input = isinstance (input , (list , tuple ))
916
+ inputs = input if is_multi_input else [input ]
917
+
915
918
self ._insert_callback (output , inputs , state , prevent_initial_call )
916
919
917
920
# If JS source is explicitly given, create a namespace and function
@@ -943,7 +946,7 @@ def clientside_callback(
943
946
"function_name" : function_name ,
944
947
}
945
948
946
- def callback (self , output , inputs , state = (), prevent_initial_call = None ):
949
+ def callback (self , output , input , state = (), prevent_initial_call = None ):
947
950
"""
948
951
Normally used as a decorator, `@app.callback` provides a server-side
949
952
callback relating the values of one or more `output` items to one or
@@ -955,6 +958,8 @@ def callback(self, output, inputs, state=(), prevent_initial_call=None):
955
958
not to fire when its outputs are first added to the page. Defaults to
956
959
`False` unless `prevent_initial_callbacks=True` at the app level.
957
960
"""
961
+ is_multi_input = isinstance (input , (list , tuple ))
962
+ inputs = input if is_multi_input else [input ]
958
963
callback_id = self ._insert_callback (output , inputs , state , prevent_initial_call )
959
964
multi = isinstance (output , (list , tuple ))
960
965
0 commit comments