I have two dcc.input’s with id’s “a” and “b”. I would like to have a callback that updates b when a is changed.
I wrote the and it will not update the value…
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash(name)
app.layout = html.Div([
dcc.Input(
id=‘input-a’,
type=‘number’,
value=9,
),
html.Div(id=‘output-a’),
dcc.Input(
id='input-b',
type='number',
value=9,
),
html.Div(id='output-b')
])
@app.callback(
dash.dependencies.Output(‘input-b’, ‘value’),
[dash.dependencies.Input(‘input-a’, ‘value’)])
def callback_a(dropdown_value):
print(dropdown_value)
return 8
if name == ‘main’:
app.run_server()