Hello,
I am using Dash (1.9.1) with dash-bootstrap-components (0.9.1) in Python (3.8.2, x64). My dashboard consists of multiple tabs with different components. However, only the components of the active tab (on loading the page) have the correct height. The height of the components on the other tabs is too small.
Example:
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
app2 = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
tab_content = dict()
tab_title = dict()
tab_name = 'nav-taba'
tab_title[tab_name] = 'Tab A'
tab_content[tab_name] = dbc.Card(
dbc.CardBody([
dbc.Row([
dbc.Col(dcc.Graph(id='nav-taba-graph1'), width=4)
])
]),
className="mt-0",
)
tab_name = 'nav-tabb'
tab_title[tab_name] = 'Tab B'
tab_content[tab_name] = dbc.Card(
dbc.CardBody([
dbc.Row([
dbc.Col(dcc.Graph(id='nav-tabb-graph1'), width=4),
dbc.Col(dcc.Graph(id='nav-tabb-graph2'), width=4),
dbc.Col(dcc.Graph(id='nav-tabb-graph3'), width=4)
])
]),
className="mt-0",
)
app2.layout = dbc.Container([
dbc.Tabs(id="nav",
active_tab='nav-taba',
children=[dbc.Tab(tab_content[name],
label=title,
tab_id=name) for name, title in tab_title.items()])
],
fluid=True)
if __name__ == '__main__':
app2.run_server(debug=True)
The graph on Tab A (active_tab) has the correct height:
While the graphs on Tab B do not:
How can I fix this problem?