-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe your context
I'm running Dash app from a python program.
- replace the result of
pip list | grep dash
below
dash 2.0.0
dash-bootstrap-components 1.0.0
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-renderer 1.9.1
dash-table 5.0.0
dash-ui 0.4.0
-
if frontend related, tell us your Browser, Version and OS
- OS: Windows 10
- Browser Firefox, Chrome
- Version 94, 96 (respectively)
Describe the bug
My app has a DataTable
and I've enabled persistence
recently. Now I find that after a page refresh in the browser, the page number in the table is not persisted.
Steps to reproduce:
- Store the program below in a python file.
- Run the file with dependencies as show above.
- In the browser a table will be shown with paging controls below it.
- Change to a page other than page number 1.
- Refresh the page.
Code:
import dash
import dash_table
import pandas as pd
from dash import html
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/solar.csv")
app = dash.Dash(__name__)
app.layout = html.Div(
[
dash_table.DataTable(
id="table",
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict("records"),
persistence=True,
page_action="native",
page_size=6,
),
html.Div(id="output"),
]
)
if __name__ == "__main__":
app.run_server(debug=True)
Expected behavior
After the page is refreshed the table remain in the same page number as before refreshing.
Actual behavior
After the page is refreshed the table returns to page number 1.
Metadata
Metadata
Assignees
Labels
No labels