Is there a way to have a dbc.Input as an option in dcc.DropDown? My use case is that I have some predefined options for the DropDown and I want to also let the user create and select a new option that they type into the Input.
Hi @Brent just recently I answered a similar question, I have a working version of it here (app still in progress)
source code here:
Thank you, that worked very well. One issue I have when I implemented it is that when I create my new value and click on ok, the new value shows as the selected value but the options list does not close(i.e. the option twisty stays open and shows the list of options). Is there a way to close the option list when the new value is added?
Hey @Brent I’m not sure about that.
What you could do is create the new entry and select it manually afterwards. You can achieve this by commenting out line 126 of my github code.
If they are going to the trouble of creating a new option, it is probably because they want to select that option so I think it is better to select the value and make them do one extra click to close the options rather than not select the new option and have them do multiple clicks to then select the option they just created. It just seem like to me there should be some kind of property for the dropdown twisty like is_open that could be changed to close the drop down list.