Skip to content

[BUG] Dash 2.1 - RadioItems doesn't take value as 2nd positional argument #1840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
LiamConnors opened this issue Nov 18, 2021 · 0 comments · Fixed by #1866
Closed

[BUG] Dash 2.1 - RadioItems doesn't take value as 2nd positional argument #1840

LiamConnors opened this issue Nov 18, 2021 · 0 comments · Fixed by #1866
Assignees

Comments

@LiamConnors
Copy link
Member

Dash 2.1 - RadioItems doesn't take value as 2nd positional argument.

  • replace the result of pip list | grep dash below
dash                 2.1

Describe the bug

Running the following app where value is provided as a keyword argument loads with Montreal selected:

import dash_core_components as dcc
import dash

app = dash.Dash(__name__)

app.layout = dcc.RadioItems(
    options=[
        {'label': 'New York City', 'value': 'NYC'},
        {'label': 'Montréal', 'value': 'MTL'},
        {'label': 'San Francisco', 'value': 'SF'}
    ],
    value='MTL'
)

if __name__ == "__main__":
    app.run_server(debug=True)

Running it with positional arguments for options and value, no value is selected on load:

import dash_core_components as dcc
import dash

app = dash.Dash(__name__)

app.layout = dcc.RadioItems(
    [
        {'label': 'New York City', 'value': 'NYC'},
        {'label': 'Montréal', 'value': 'MTL'},
        {'label': 'San Francisco', 'value': 'SF'}
    ],
    'MTL'
)

if __name__ == "__main__":
    app.run_server(debug=True)

Expected behavior

Montreal should show on load as the value is set to 'MTL' with the second positional argument

@LiamConnors LiamConnors changed the title Dash 2.1 - RadioItems doesn't take value as 2nd positional argument [BUG] Dash 2.1 - RadioItems doesn't take value as 2nd positional argument Nov 18, 2021
@HammadTheOne HammadTheOne self-assigned this Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants