Set value of checklist by label when options is given as list of dicts

Hi! So this works as expected and the first two options are selected by default:

app.layout = html.Div([dcc.Checklist(
        id='checklist',
        options={str(i): f'{10 + i}' for i in range(5)},
        value=['0', '1'],
)

In this example, however, nothing is selected by default:

app.layout = html.Div([dcc.Checklist(
        id='checklist',
        options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
        value=['0', '1'],
)

This works as well:

app.layout = html.Div([dcc.Checklist(
        id='checklist',
        options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
        value=['10', '11'],
)

But I would like to use the labels instead.

By the way, this also doesn’t work (returns errors):

app.layout = html.Div([dcc.Checklist(
        id='checklist',
        options=[{'label': str(i), 'value': f'{10 + i}'} for i in range(5)],
        value=[{'label': '10'}, {'label': '11'}],
)

Hi @lambdakappatheta
This piece of code won’t work because if the first label is selected its value is 10. So choosing the default values 0 or 1 won’t do anything because they don’t exist.