Say I have two labels in my dropdown:
ab
b
If I were to search “b” I would see “ab” above “b” in the dropdown options. Is there a way to make the search read from the left so that we see “b” above “ab” in the dropdown options?
Say I have two labels in my dropdown:
ab
b
If I were to search “b” I would see “ab” above “b” in the dropdown options. Is there a way to make the search read from the left so that we see “b” above “ab” in the dropdown options?
chriddyp pointed me to the Dynamic Options example on https://dash.plotly.com/dash-core-components/dropdown and I solved it using:
return [o for o in options if re.match(search_value, o[“label”], re.IGNORECASE)]
for front matches only or:
opt = [o for o in options if re.match(search_value, o[“label”], re.IGNORECASE)]
opt.extend([o for o in options if o not in opt and search_value in o[“label”]])
return opt
thanks market, very much appreciated