Hi all,
Using DropDownMenu and -Item via navbar I have the problem that after click on nested item that menu area disappears, but the parent doesn’t. So it is still there together with new page content, which shall not be the case.
Part of that coding is:
dbc.DropdownMenu(
id='decimal_dynasties',
children=[
dbc.DropdownMenuItem(
name,
id=name,
n_clicks=0,
href='/pages/'.join([name.replace(' ', '_').lower(), '/']),
) for name in decimal_dynasty_names
],
label='10th Dynasties',
toggle_style={
# Tints of french grey
"background": '#E1DFD6',
'color': 'black',
},
className="mt-1 px-1",
align_end=True,
),
Furthermore, if I click on one of the nested items the first time, the content of the 404 page appears, after second click on the same item the correct page is shown.
As root cause I investigated the string-join coding line, because when I change that line to
href='/pages/' + name.replace(' ', '_').lower() + '/',
such issue does not appear. But in general, join is the better option for string concatination.
I am confused, why does this happen? Is the join method to fast?
In advance, thanks for help!
Ilona