dash-extensions icon indicating copy to clipboard operation
dash-extensions copied to clipboard

[Callbacks] Named arguments not supported

Open gv-collibris opened this issue 3 years ago • 1 comments

Dash now supports named arguments in the callbacks (see here). However, using it with dash-extensions does not work.

MWE:

from dash import dcc, html, Input, Output, Dash
from dash_extensions import Dash as DashExtensions

# app = Dash(__name__) # this works
app = DashExtensions(__name__) # this does not

app.layout = html.Div([
    html.H6("Change the value in the text box to see callbacks in action!"),
    html.Div([
        "Input: ",
        dcc.Input(id='my-input', value='initial value', type='text')
    ]),
    html.Br(),
        html.Div(id='my-output'),
    ])


@app.callback(
    output=[Output('my-output', 'children')],
    inputs={'input_value': Input('my-input', 'value')}
    )
def update_output_div(input_value):
    return [f'Output: {input_value}']


if __name__ == '__main__':
    app.run_server(debug=True)

gv-collibris avatar Feb 15 '22 08:02 gv-collibris

Support has been added in dash-extensions==0.1.3. Please let me know if everything works as intended.

emilhe avatar May 13 '22 13:05 emilhe