I have this button:
dbc.Button(
“DO SOMETHING”,
color=”primary”,
id=”button1″,
autofocus = True,
n_clicks=int(0),
size="lg",
className="mb-4 w-100",
),
Which triggers the following function:
def init_callbacks(self):
@self.app.callback(
Output("dashboard1", "data"),
[Input("button1", "n_clicks")],
[
State("selectbook", "value"),
State("date1", "value"),
State("ticker", "value"),
State("ticker_filter", "value"),
State("instrument_type_filter", "value"),
],
)
@log_callback(logger)
def initialize_table(
n_clicks: int,
book: str,
date: str,
strategy_filter: str,
ticker_filter: str,
instrument_type_filter: str,
) -> list:
Is there a way to trigger the button any time the user clicks enter on the screen?
Thanks
I have so far tried autofocus with n_submit but have not managed to make it work.
New contributor
Juan Castro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.