question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScrollToRow does not work for the last few rows

See original GitHub issue

Describe 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.

tabulator_bug

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version 72.0.3626.119

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gillezcommented, Oct 4, 2019

Thanks Oli. Only just noticed this update. I’ll remove my fix/hack (in the pul request) and try the new version.

1reaction
alainfrischcommented, Mar 6, 2019

I can confirm #1697 fixes my issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found