Hello,
I have attached a simple plotly table that gets filled by some dummy data:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Plotly Table Scroll Issue</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
<div id="logTable"></div>
<script>
let dataCount = 20;
function getData() {
const timestamps = [];
const messages = [];
for (let i = 0; i < dataCount; i++) {
timestamps.push("Time " + i);
messages.push("Message " + i);
}
return { timestamps, messages };
}
function drawTable() {
const d = getData();
const tableData = [{
type: 'table',
header: { values: [["<b>Timestamp</b>"], ["<b>Message</b>"]]},
cells: { values: [d.timestamps, d.messages]}
}];
Plotly.react('logTable', tableData, {});
}
drawTable();
setInterval(() => {
dataCount += 5;
drawTable();
}, 2000);
</script>
</body>
</html>
My problem is that on each update, the scroll (vertical) automatically goes to the top of the table.
How can I stop this behavior? I want for scroll bar to persist where I left it.
Thank you!