tabulator icon indicating copy to clipboard operation
tabulator copied to clipboard

Horizontal Scroll Lost On Filtering to zero rows

Open runawaycoin opened this issue 2 years ago • 2 comments

Tabulator Info Tabulator version 5.1.8

Working Example https://jsfiddle.net/b486utcL/

To Reproduce

  1. load data where Horizontal Scroll is enabled
  2. select a filter so no rows are shown (eg Enter in option4 column filter something like: "5" )
  3. notice the Horizontal Scroll bar disappears and so does the column

Expected behavior Horizontal Scroll bar stays and focused column is shown

Note, if the table is loaded with no row data - Horizontal Scroll bar is correctly shown.

runawaycoin avatar Apr 06 '22 19:04 runawaycoin

Hey @runawaycoin

Thanks for the headsup, i have pushed a fix for this to the 5.3 branch that will be released in a couple of weeks.

Cheers

Oli :)

olifolkerd avatar Jun 26 '22 15:06 olifolkerd

Hello.

I see that it still occurs in version 5.3.2👀 https://jsfiddle.net/udohjm4s/2/

Once the filter is set, it works fine.

        table.setFilter('', '=', '');
        setTimeout(()=>{
            table.clearFilter();
        });

kinto-alpine avatar Aug 23 '22 04:08 kinto-alpine

Having similar issue in 5.4.0. When header filtering have 0 rows, the scroll bar gets stuck all the way on the first column. So, you can really clear your filter since you are not able to scroll back to the column you were at.

Table configuration:

new Tabulator("#statusTable", {
    persistence: {
      sort: true, //persist column sorting
      filter: true, //persist filter sorting
      group: true, //persist row grouping
      page: false, //persist page
      columns: true, //persist columns
    },
    movableRows: true,
    movableColumns: true,
    clipboard: true,
    pagination: "local",
    paginationSize: 100,
    paginationSizeSelector: [100, 300, 600, 1000],
    paginationCounter: "rows",
    data: data,
    columns: columnDefinitions,
  });

An option could be to set the columns as scrollable as well since there is no data available.

rigogsilva avatar Oct 13 '22 20:10 rigogsilva

Hi @olifolkerd ,

Is the issue mentioned by @runawaycoin fixed in 5.3? I am using 5.3 and upgraded to 5.4, but I still have the same issue.

Thanks, Robert

RJR-Robert-Kewei-Zhang avatar Oct 31 '22 14:10 RJR-Robert-Kewei-Zhang

Hi It seems to be fixed in Ver. 5.4.4. https://jsfiddle.net/hswe2pdx/

Thanks. And thanks again!

kinto-alpine avatar Feb 22 '23 07:02 kinto-alpine

Thanks @kinto-alpine

indeed it seems fixed in v5.4.4

I added this (350px is my sidebar width) to the container and worked very well.

style="max-width: calc(100vw - 350px)"

runawaycoin avatar Feb 22 '23 09:02 runawaycoin