Open emilykl opened 2 years ago
Updated workaround:
from dash import Dash, callback, clientside_callback, Input, Output, State, dcc, html, ctx
from dash import Dash, dcc, html, dash_table, Input, Output, State, callback
import base64
import datetime
import io
import pandas as pd
app = Dash(__name__)
app.layout = html.Div([
dcc.Dropdown(options=['AB', 'CCD', 'EF', 'G'], id='drop'),
html.Div(id='dummy'),
# optional, for demo purposes
html.Div('I will be updated when the dropdown value changes!', id='out')
])
clientside_callback(
"""
function (val, dropdown_id) {
document.getElementById(dropdown_id).querySelector('input').blur();
return [];
}
""",
Output('dummy', 'children'),
Input('drop', 'value'),
State('drop', 'id'),
prevent_initial_call=True
)
# optional, for demo purposes
@callback(
Output('out', 'children'),
Input('drop', 'value'),
prevent_initial_call=True
)
def cbtest(value):
return f"Value is {value}"
if __name__ == '__main__':
app.run(debug=True)
Describe your context
Describe the bug
Steps to reproduce:
Expected behavior
The dropdown menu does not reopen when switching back to the window
Screenshots
https://user-images.githubusercontent.com/4672118/154557082-3633d611-e520-4745-8aff-3e80b4ebd7c1.mov
Minimal example
(it's just an app with a dropdown)