ScrollToRow does not work for the last few rows
See original GitHub issueDescribe the bug
If passed one of the last rows, ScrollToRow fails to make it visible, be it with “center” or “bottom” position.
Tabulator Info
- Which version of Tabulator are you using: 4.2.2
Working Example
<html>
<head>
<link href="https://unpkg.com/tabulator-tables@4.2.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.2.2/dist/js/tabulator.min.js"></script>
</head>
<body>
<div id="example-table"></div>
<input id="row-id"/>
<button onclick="scroll_to_row('bottom')">Scroll to row (bottom)</button>
<button onclick="scroll_to_row('center')">Scroll to row (center)</button>
<button onclick="scroll_to_row('top')">Scroll to row (top)</button>
<script type="text/javascript" src="test.js"></script>
</body>
</html>
var tabledata = [];
for (i = 1; i < 100; i++) {
tabledata.push({id:i, name:i});
}
var table = new Tabulator("#example-table", {
height:205,
data:tabledata,
layout:"fitColumns",
columns:[
{title:"Name", field:"name", width:150},
],
});
function scroll_to_row(kind) {
table.scrollToRow(document.getElementById("row-id").value, kind, true);
}
Expected behavior
When typing “98” in the field and click on “Scroll to row (bottom/center)”, I would expect row 98 to become visible, but Tabulator does not scroll enough.
Screenshots
The movie below illustrates to scrolling to row 50 works fine with any of the three modes; but 98 works only with top, not bottom nor center.
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome
- Version 72.0.3626.119
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (6 by maintainers)
Top Results From Across the Web
scrollToRow doesn't always scroll … | Apple Developer Forums
I created a dummy app with 300 rows and no sections. The 'scrollToRow' function works fine with the vast majority of cases. But...
Read more >scrollToRowAtIndexPath doesn't handle the last row properly
As you can see, the very last row (September) isn't scrolled fully into view; the bottom few pixels are cut-off. I've tried using...
Read more >ScrollToRow - - DataWindow Reference
If row is greater than the last row number, it scrolls to the last row. If row is visible without scrolling, the DataWindow...
Read more >ScrollToRow
ScrollToRow changes the current row but not the current column. ... If row is greater than the last row number, it scrolls to...
Read more >Worksheet's ScrollToRow() and ScrollToColumn() do not work ...
I want to add scrolling worksheet when ScrollLock is pressed, similar to MS Excel. It works while there are no frozen rows and/or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks Oli. Only just noticed this update. I’ll remove my fix/hack (in the pul request) and try the new version.
I can confirm #1697 fixes my issue.