Hello!
I have a html table with 5 columns, one of this columns is a dropdown.
This dropdown has too many options, so I was trying to apply the dynamic options in this dropdown to limit the options according to user search.
@app.callback(
Output({'type': 'carrier-dropdown', 'index': MATCH}, 'options'),
[Input({'type': 'carrier-dropdown', 'index': MATCH}, 'search_value')],
State('hidden-carriers-list', 'children'),
prevent_initial_call=True
)
def update_carrier_dropdown(search_value,hidden_carriers_list):
carrier_list = json.loads(hidden_carriers_list)
carrier_options = [item['carrier'] for item in carrier_list]
options = generate_dropdown_carrier(carrier_options)
if search_value and len(search_value) > 3:
return [o for o in options if search_value.upper() in o['label'].upper()]
else:
return dash.no_update
The problem is that I can only type one character (letter) and then the dropdown closes, it looks like it is rerendered.
Does anyone have a solution for this?