I have two things I want to accomplish in below example of Dash application.
- Keep the Tabs bar "frozen" on the top of application, so If someone scrolled down to e.g. 500 row can easily select other tab without scrolling "up"
- If 1 achieved. "Remember" at which Row user scrolled down so when changing between tabs it's still on the same Row of application.
Simplified app:
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
# App
app = dash.Dash(__name__,
external_stylesheets=[dbc.themes.FLATLY],
title='TestCards')
server = app.server
# Layout
text = [[f'Row_{i}', html.Br()] for i in range(1000)]
text = [item for sublist in text for item in sublist]
tab1_content = html.Div([html.H1(f'Title Tab1'),
html.P(text)])
tab1 = dbc.Card(dbc.CardBody([tab1_content]))
tab2_content = html.Div([html.H1(f'Title Tab2'),
html.P(text)])
tab2 = dbc.Card(dbc.CardBody([tab2_content]))
app.layout = html.Div([dbc.Tabs(
[dbc.Tab(tab1, label='Tab1'),
dbc.Tab(tab2, label='Tab2')])])
# Run App
app.run_server(host='0.0.0.0', debug=False)

