Autocomplete : renderInput attribute
Hi okld and hi everyone, I hope this project still lives because it's very helpful to render nice Streamlit apps.
I'm working with Autocomplete component from MUI but I'm struggling making it works. The issue here is that mui.Autocomplete object needs a renderInput prop (it should be a lambda function returning another component such as TextField). Here is how I proceed to try making it works :
with elements("some-name"):
options=[{"label": labels[i], "id": i} for i in range(len(labels))] # labels is defined as a list of strings
autocomplete = mui.Autocomplete(options=options, renderInput=lambda params: mui.TextField(params, label="Some label"))
The problem here is that it throws an ElementsFrameError cause mui.TextField is out of an with elements("id") statement.
I tried some variations such as :
- wrapping the mui.TextField in a function defined before the mui.Autocomplete declaration : but it renders the TextField without Autocomplete before other declared elements...
- passing a mui.TextField in a with mui.Autocomplete(options=options) statement. As expected, it throws an Exception because the renderInput prop isn't specified...
My question is : How to make mui.Autocomplete work with streamlit-elements module ?
NB : Moreover, I was wondering if we could have some tutorials on how to make Date Pickers work for example. Thank you very much for your help and consideration
Victor
@vcourintracks did you figured out how to make autocomplete work?
Anyone figured out how the autocomplete work?