【发布时间】:2021-11-11 14:45:52
【问题描述】:
我在破折号回调中有一些输入表单,可将输入转换为文本摘要。
现在,我必须单击一个按钮来刷新该文本摘要,但我希望刷新是自动的 - 每当用户在输入框中编辑值时。
我尝试将State 变量更改为Input 并删除回调输入中对按钮的引用,但这并没有帮助 - 我仍然需要点击按钮以刷新文本。
有没有办法让文本摘要在用户更改输入框时自动刷新?
@app.callback(
Output('desc', 'children'),
Input('submit-button-choose-event', 'n_clicks'),
State("full-input-boxes", "children"),
)
def refresh_desc(n_clicks,children):
txt = ''
if children:
inputs = [i["props"] for i in children["props"]["children"] if i["type"] == "Input"]
#process the inputs into txt
return txt
【问题讨论】:
标签: python plotly-dash