dropdown 'label' doesn't render (seemingly) depending on 'value'
See original GitHub issueHi, Possible bug report: Dropdown labels won’t render in the dropdown box if the corresponding ‘value’ for the label is a tuple.
In below example: selecting test_label0
will result in no rendering of test_label0
in the dropdown box. Selecting test_label1
will result in it correctly rending within the dropdown box.
Expected behaviour: that label would always render in dropdown irrespective of value
value.
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
dropdown_options = [
{'label':'test_label0', 'value':(0,'test_label0')},
{'label':'test_label1', 'value':1},
]
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='dropdown_test'),
dcc.Dropdown(
id='dropdown',
options=dropdown_options,
)])
if __name__ == '__main__':
app.run_server(debug=True)
On OSX, install via pip in conda env:
dash 0.19.0 <pip>
dash-core-components 0.15.4 <pip>
dash-html-components 0.8.0 <pip>
dash-renderer 0.11.1 <pip>
dash.ly 0.17.3 <pip>
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Dropdown doesn't show values - Power Platform Community
Dropdown menu that displays values depending on which radio button is pressed. 3. Gallery that is filtered based on what dropdown value user...
Read more >floating label dropdown not working - Stack Overflow
Im creating a floating label , i manage to make a floating label on textbox but in my dropdown it doesn't work. hope...
Read more >PowerApps Cascading Dropdown - See comments for 2021 ...
New version available here - https://www.youtube.com/watch?v=SKMwayf_cuMIn today's show, you learn about PowerApps cascading dropdown menus.
Read more >Populate Dropdown Lists in ASP.NET MVC Razor Views
Building on that functionality, we'll look at how to populate the State/Province/Region dropdown based on the country selected.
Read more >How To Use Checkboxes In Google Sheets - Ben Collins
A checkbox in Google Sheets has a value TRUE when checked and FALSE ... Any idea on how to dynamically select a checkbox...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ned2 sorry for the lack of response!
The “bug” (clearly not actually a bug) stopped, and I couldn’t track down what the change was.
But thanks for the response, and right that the issue is now closed 👍
I don’t seem to be able to reproduce this behaviour using your same Dash dependencies. Here’s the code I’m using:
Note also that you should probably be providing an initial value for
value
when you initialize the Dropdown, otherwise it will get the valueNone
on each initial page load.