I am trying to build a dropdown menu in dash, where the text of the placeholder should be defined by another callback.
What I tried so far is to have the placeholder defined by a html.Div, like this: dcc.Dropdown(id = 'test_dropdown', options = [{'label': 'Test1', 'value': '1'},{'label': 'Test2', 'value': '2'}], placeholder = html.Div(id = 'test_placeholder')), with the text being defined by the other callback. This resulted in the following error message: Invalid argument placeholder passed into Dropdown with ID "test_dropdown".
Expected string.
Was supplied type array.
If I remove the square brackets around the html.Div, the error message becomes: The dash_core_components.Dropdown component (version 1.16.0) with the ID "test_dropdown" detected a Component for a prop other than children
Did you forget to wrap multiple children in an array?
Prop placeholder has value Div(id='test_placeholder')
Has anyone got suggestions on how I could implement a placeholder that depends on another dropdown? Or would it be better to implement multiple dropdowns, and hide all but one using a hidden html.Div?
Thanks in advance for your help