Когда пользователь вводит значение в один вход, я хочу, чтобы значение в другом было очищено... но НЕ вызывать последующий обратный вызов, который обновит выход. Возможно ли это?
Код: Выделить всё
app.layout = html.Div([
dcc.Input(id="foo"),
dcc.Input(id="bar"),
html.div(id="out")
])
@callback(
Output("out", "children", allow_duplicate=True),
Output("bar", "value"), # changing this shouldn't trigger from_bar
Input("foo", "value"),
prevent_initial_call=True,
)
def from_foo(value: str):
return (f"foo={value}", "")
@callback(
Output("out", "children", allow_duplicate=True),
Output("foo", "value"), # changing this shouldn't trigger from_foo
Input("bar", "value"),
prevent_initial_call=True,
)
def from_bar(value: str):
return (f"bar={value}", "")
Подробнее здесь: https://stackoverflow.com/questions/792 ... that-chang
Мобильная версия